PC Review


Reply
Thread Tools Rate Thread

click events no longer work for controls within a Multipage contro

 
 
=?Utf-8?B?SHV6ZWZh?=
Guest
Posts: n/a
 
      4th Oct 2007
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

 
Reply With Quote
 
 
 
 
Elroyskimms
Guest
Posts: n/a
 
      5th Oct 2007
On Oct 4, 3:52 am, Huzefa <Huz...@discussions.microsoft.com> wrote:
> 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

 
Reply With Quote
 
=?Utf-8?B?SHV6ZWZh?=
Guest
Posts: n/a
 
      8th Oct 2007
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.com> wrote:
> > 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
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multipage, controls-collection and events (XL2003, VBA) Holger Gerths Microsoft Excel Programming 0 7th Jun 2010 05:06 PM
click events no longer work on dynamically loaded web user control =?Utf-8?B?Smlt?= Microsoft ASP .NET 2 20th Aug 2007 04:32 AM
Click Events on a MultiPage =?Utf-8?B?R2VvZmY=?= Microsoft Excel Programming 0 11th Nov 2006 04:19 PM
Pvt Sub X_Click(...) Handles btn1.Click, btn2.Click - multi contro =?Utf-8?B?UmljaA==?= Microsoft VB .NET 7 23rd Sep 2005 11:17 PM
Events for Controls in a Multipage Control George Microsoft Excel Programming 4 18th Feb 2004 05:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:29 AM.