469,964 Members | 1,474 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,964 developers. It's quick & easy.

click events no longer work for controls within a Multipage contro

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

Oct 4 '07 #1
2 1317
On Oct 4, 3:52 am, Huzefa <Huz...@discussions.microsoft.comwrote:
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

Oct 5 '07 #2
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.

"Elroyskimms" wrote:
On Oct 4, 3:52 am, Huzefa <Huz...@discussions.microsoft.comwrote:
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

Oct 8 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by sukanya s via .NET 247 | last post: by
reply views Thread by dotnetkumar | last post: by
12 posts views Thread by scsharma | last post: by
reply views Thread by Kamen | last post: by
18 posts views Thread by eliss.carmine | last post: by
1 post views Thread by rainxy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.