PlaceHolder and UserControls

  • Thread starter Thread starter David
  • Start date Start date
D

David

I have a UserControl loaded into a PlaceHolder and I have a button
there which is suppose to load another UserControl into the same
PlaceHolder and hide the previous one. Why does the events of the
controls that are inside the second UserControl doesn't work the first
time I try to rise them?
 
Are you adding the controls to the placeholder at runtime? If you are,
then the controls need to be re-added to the placeholder on each
subsequent postback. Otherwise postback data will not be available,
events will not be wired etc.. here is a link that describes the
lifecycle of asp.net, it helped me understand what you need to do:

http://msdn2.microsoft.com/en-us/library/ms178472.aspx

hope that helps!

Sean
 
Yes, I'm adding those controls at runtime, and I re-add them on each
subsequent postback, and still, I doesn't work.
Please, can you send me a simple project where I can see how can I
solve this problem.
thank you very much.
 
Back
Top