click events no longer work for controls within a Multipage contro

G

Guest

Hi,

I am using a Multipage control with ASP.Net 1.1. The events for controls
within the multipage are not getting fired. Any ideas why this would happen.
It was working fine before i added another usercontrol to the page.

Thanks
 
E

Elroyskimms

Hi,

I am using a Multipage control with ASP.Net 1.1. The events for controls
within the multipage are not getting fired. Any ideas why this would happen.
It was working fine before i added another usercontrol to the page.

Thanks

Anytime I ran into this problem, it was because I was adding the User
Controls to the page in the Load event. If you add the User Controls
in the Load event my experience has shown me that events are not fired
beyond a couple generations (parent control -> child control -> child
control -> etc.). So, make sure you add all User Controls in the Init
event of the page, not Load.

Also, if you are dynamically adding controls in the Init event, you
need to be sure to add the controls every time the page loads,
including postbacks. You can't have your User Control being loaded
inside an If Not Page.IsPostBack block. The controls need to be added
on Postbacks as well as initial loads.

If those don't help, try posting some sample code and I will try to
take a closer look.

-E
 
G

Guest

My issue turned out to be a bit different. The problem was when I am adding a
new control to the page, the designer is automatically removing the event
mappings from initializeComponent(). So I have to add the event maps for all
controls again. Any thoughts on why this happens.

:
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top