Events not firing when loading multiple usercontrols with LoadControl

  • Thread starter Stijn Vrancken via .NET 247
  • Start date
S

Stijn Vrancken via .NET 247

I'm loading 3 usercontrols (.ascx) in a container page (.aspx)

When I load them like this :

//-----------
HtmlForm Form1 = (HtmlForm)Page.FindControl("Form1");
Form1.Controls.AddAt(0, LoadControl( "UserControls/AdminHeader.ascx" ) );
TD1.Controls.Add( LoadControl( "Downloads/UserControls/DownloadManager.ascx" ) );
Form1.Controls.Add( LoadControl( "UserControls/AdminFooter.ascx" ) );
//-----------

The pageLoad event on DownloadManager.ascx gets fired, but not the Edit, Update or Delete Datagrid events?


When I only load DownloadManager.ascx everything works fine ?

TD1.Controls.Add( LoadControl( "Downloads/UserControls/DownloadManager.ascx" ) );

Why are the events lost when loading multiple controls ?
 

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,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top