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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top