Serializer for dynamic control
2008-06-19 23:59
225 查看
using System;
using System.IO;
using System.Collections;
using System.Runtime.Serialization.Formatters.Binary;
using System.Runtime.Serialization;
using System.Web;
using System.Text;
public class Serializer
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections;
using System.IO;
using System.Text;
public partial class _Default : System.Web.UI.Page
{
#region "OnInit"
protected override void OnInit(EventArgs e)
{
//base.OnInit(e);
//string inform = Request.Form[hfHolder.ClientID];
//if (!string.IsNullOrEmpty(inform))
//{
// string[] array = inform.Split(';');
// string type = array[0];
// string id = array[1];
// if (type == "TextBox")
// {
// TextBox tb = new TextBox();
// tb.ID = id;
// PlaceHolder1.Controls.Add(tb);
// }
//}
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(hfHolder.Value))
{
Hashtable h = Serializer.WebDeserialize(hfHolder.Value) as Hashtable;
Response.Write(h["test"].ToString());
}
}
protected void Button1_Click(object sender, EventArgs e)
{
//if (string.IsNullOrEmpty(hfHolder.Value))
//{
// TextBox tb = new TextBox();
// tb.ID = "test";
// PlaceHolder1.Controls.Add(tb);
// hfHolder.Value = "TextBox;test";
//}
}
protected void Button2_Click(object sender, EventArgs e)
{
Hashtable h = new Hashtable();
h.Add("test", "007");
hfHolder.Value = Serializer.WebSerialize(h);
}
}
using System.IO;
using System.Collections;
using System.Runtime.Serialization.Formatters.Binary;
using System.Runtime.Serialization;
using System.Web;
using System.Text;
public class Serializer
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections;
using System.IO;
using System.Text;
public partial class _Default : System.Web.UI.Page
{
#region "OnInit"
protected override void OnInit(EventArgs e)
{
//base.OnInit(e);
//string inform = Request.Form[hfHolder.ClientID];
//if (!string.IsNullOrEmpty(inform))
//{
// string[] array = inform.Split(';');
// string type = array[0];
// string id = array[1];
// if (type == "TextBox")
// {
// TextBox tb = new TextBox();
// tb.ID = id;
// PlaceHolder1.Controls.Add(tb);
// }
//}
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(hfHolder.Value))
{
Hashtable h = Serializer.WebDeserialize(hfHolder.Value) as Hashtable;
Response.Write(h["test"].ToString());
}
}
protected void Button1_Click(object sender, EventArgs e)
{
//if (string.IsNullOrEmpty(hfHolder.Value))
//{
// TextBox tb = new TextBox();
// tb.ID = "test";
// PlaceHolder1.Controls.Add(tb);
// hfHolder.Value = "TextBox;test";
//}
}
protected void Button2_Click(object sender, EventArgs e)
{
Hashtable h = new Hashtable();
h.Add("test", "007");
hfHolder.Value = Serializer.WebSerialize(h);
}
}
相关文章推荐
- A Dynamic Motion Control Technique for Human-like Articulated Figures
- Page and Form for dynamic Loading Control
- How to control fan speed?special for Thinkpad
- Method, apparatus, and system for speculative abort control mechanisms
- ThinkAir: Dynamic resource allocation and parallel execution in the cloud for mobile code offloading阅读笔记
- [论文笔记]An adaptive algorithm for failure recovery during dynamic service composition (PReMI@LNCS, 2007)
- Visual C++ ActiveX Control for hosting Office documents in Visual Basic or HTML
- Automated Test Generation for Access Control Policies via Change-Impact Analysis
- struts2 2.5动态方法调用(DMI) dynamic method invoke 出现不被允许的方法时 Method add for action dynamic is not allowed! - [unknown location]
- 关于vsftp出现Restarting vsftpd (via systemctl): Job for vsftpd.service failed because the control 的解决办法
- [转]6 Tweaks for your ASP:Menu Control
- No serializer found for class org.hibernate.proxy.pojo.javassist.JavassistLazyIn
- Setting Expires and Cache-Control: max-age headers for static resources in ASP.NET
- 【版本更新】BCGControlBar Pro for MFC v24.4正式发布
- EXECUTE IMMEDIATE option for Dynamic SQL and PL/SQL
- sendActionsForControlEvents
- HttpMessageNotWritableException: Could not write JSON: No serializer found for class ****
- Jenkins 安装启动提示“iJob for jenkins.service failed because the control process exited with error code. See "systemctl status jenkins.service" and "journalctl -xe" for details.”
- Job for vsftpd.service failed because the control process exited with error code. See "systemctl sta
- [论文泛读] Dynamic placement of virtual machines for managing sla violations (IM, 2007)