Dynamically loading User Controls

  • Thread starter Christian Resma Helle
  • Start date

C

Christian Resma Helle

Hey guys,

I'm working on an AJAX Enabled ASP.NET Web application. I have a TreeView
web control and an PlaceHolder web control. My PlaceHolder is inside an
UpdatePanel and AsyncPostBacks are triggered by the SelectedNodeChanged
event of the TreeView. I dynamically load user controls into my PlaceHolder
depending on what node the user clicks on the TreeView. The user control is
loaded into the page and is displayed to the user.

These user controls would normally have a buttons for save, update, and
delete operations. My problem is that "SOMETIMES" when I click on a button
in my dynamically loaded user control, the user control is just reloaded and
the button click event is not fired. This problem does not occur every time
though, which makes it very annoying!

Any ideas on how to ensure that buttons within my dynamically loaded user
controls fire click events everytime its clicked?
 
Ad

Advertisements

C

Christian Resma Helle

Found the problem! I did not set the ID of the UserControl I wanted to load
dynamically.
 

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

Top