Dynamically loading User Controls

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Christian Resma Helle

    Dynamically loading User Controls

    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 SelectedNodeCha nged
    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?

    --
    Regards,
    Christian


  • Christian Resma Helle

    #2
    Re: Dynamically loading User Controls

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

    --
    Regards,
    Christian

    "Christian Resma Helle" <christian [dot] helle [at] yahoo [dot] comwrote
    in message news:euVMZe99IH A.5228@TK2MSFTN GP06.phx.gbl...
    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 SelectedNodeCha nged
    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?
    >
    --
    Regards,
    Christian
    >
    >

    Comment

    Working...