PlaceHolder and UserControls

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?
 
S

Sean Chambers

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
 
D

David

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.
 

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

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top