Control Disapper

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi to all
i have a web user control when i click a button in my form i load this control
but when i click other button this user control dissaper i dont whant that
to be done ?? how ??
 
Hi,

you need to load controls on every request because only control state is
restored over the postback, not control instances. You can for example have
flag variables (in ViewState) for controls which you set on (in button's
click handler) when you want to have controls visible and then create the
control. On postback check this flag on Page_load and recreate the control.
 
Back
Top