我是在一个WebUserControl1里的Page_Load,
动态加另一个WebUserControl2
代码:
Dim ctl As WebUserControl2
ctl = CType(Me.LoadControl("WebUserControl2.ascx"), WebUserControl2)
ctl.ID = "1"
Me.divBody.Controls.Add(ctl)aspx文件里只加入了WebUserControl1当PostBack的时候,加好的WebUserControl2都没了
怎么能解决?
动态加另一个WebUserControl2
代码:
Dim ctl As WebUserControl2
ctl = CType(Me.LoadControl("WebUserControl2.ascx"), WebUserControl2)
ctl.ID = "1"
Me.divBody.Controls.Add(ctl)aspx文件里只加入了WebUserControl1当PostBack的时候,加好的WebUserControl2都没了
怎么能解决?
{
//code;
}
http://blog.joycode.com/saucer/archive/2004/04/14/19456.aspx
=================>
值在ViewState中
谢谢了