User Control bug in ASP.NET 2.0?

G

Guest

I currently have a project in production running under ASP.NET 1.1. The
project contains a page that loads a User Control dynamically in the
Page_Load event and then adds the User Control to a placeholder controls
collection. The User Control contains several hyperlink buttons with
corresponding event handlers that perform particular functions within the
control. In some cases the control is specifically removed from the
placeholder controls collection, then re-added later in the code. After the
add, remove, add occurrs in ASP.NET 1.1, the user control's hyperlink buttons
work fine, however in ASP.NET 2.0 the user control's events are not fired at
all for any of the hyperlink (or any button on the user control).

To summarize, the event handler in the user control will not fire properly
under ASP.NET 2.0 with the following code in the Page_Load:

formsControl = Page.LoadControl(controlVirtualPath)
InnerFormControlPlaceholder.Controls.Add(formsControl)
InnerFormControlPlaceholder.Controls.Remove(formsControl)
InnerFormControlPlaceholder.Controls.Add(formsControl)

Note: The code above is not the actual code in the project (no one would
actually do this), however the code above should still technically work (The
event handlers in the user control fire correctly in ASP.NET 1.1, but not in
ASP.NET 2.0).

Is this a potential bug or has something changed in the underlying
infrastructure of ASP.NET 2.0 that I should be aware of?
 

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,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top