关于自定义控件中的复合控件 的 postback的问题
其中的inputbox值更改了,如何在postback之后修改那?
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
using System.Text;
using System.Collections.Specialized;
namespace WebControl1
{
public class Test : System.Web.UI.WebControls.WebControl,IPostBackDataHandler
{
public string[] Array;
protected override void Render(HtmlTextWriter output)
{
if(Array!=null)
{
output.Write("<table>");
for(int i=0;i<Array.Length;i++)
{
output.Write("<tr><td>");
output.Write("<input type=\"text\" name=\"" + this.UniqueID + ":" + i + "\" value=\"" + Array[i] + "\">");
output.Write("</td></tr>");
}
output.Write("</table>");
}
}
protected override object SaveViewState()
{
return (object)Array;
}
protected override void LoadViewState(object state)
{
Array=(string[])state;
}
public bool LoadPostData(string postDataKey,NameValueCollection postData)
{
for(int i=0;i<Array.Length;i++)
{
Array[i]=(string)postData[this.UniqueID + ":" + i];
}
TrackViewState();
return false;
}
public void RaisePostDataChangedEvent()
{
}
}
}