M
Mike Housey
Can any one please tell me the best way to persist
dynamicly added user controls through page posts. I have
unsuccessfuly tried using the session object, but this
causes event firing to go haywire.
I set it up as follows:
I have created a web form(wf1.aspx) containing a panel and
1 user control(uc.ascx) containg a dropdown list and a
text box.
On the PageLoad Event of wf1:
if(!IsPostBack)
{
Control ctl = LoadControl("uc.ascx");
Panel1.Controls.Add(ctl);
Session["ctl"] = ctl;
}
else
{
Control ctl = (Control)Session["ctl"];
Panel1.Controls.Add(ctl);
}
A listbox on the custom control has a
selectedindex_changed event which fires once the first
time it is clicked, 2x the second, and 3x the third.
Obvioulsy one is not ment to store controls in the
Session. So how do I ?
Thanks in advance,
Mike Housey
dynamicly added user controls through page posts. I have
unsuccessfuly tried using the session object, but this
causes event firing to go haywire.
I set it up as follows:
I have created a web form(wf1.aspx) containing a panel and
1 user control(uc.ascx) containg a dropdown list and a
text box.
On the PageLoad Event of wf1:
if(!IsPostBack)
{
Control ctl = LoadControl("uc.ascx");
Panel1.Controls.Add(ctl);
Session["ctl"] = ctl;
}
else
{
Control ctl = (Control)Session["ctl"];
Panel1.Controls.Add(ctl);
}
A listbox on the custom control has a
selectedindex_changed event which fires once the first
time it is clicked, 2x the second, and 3x the third.
Obvioulsy one is not ment to store controls in the
Session. So how do I ?
Thanks in advance,
Mike Housey