locked
dynamic user controls - raising events RRS feed

  • Question

  • User2045693258 posted

    ok, first off if this is in the wrong thread, my apologies.

     here's my scenario

    aspx page- dynamically loading asp:images into a placeholder. each image has a textbox attached and an ajax popup control

    each ajax popup control contains a user control displaying a list of image buttons.

    here's what i've done so far. user clicks in text box under image>popup appears containing list of image buttons

    here's what i want to happen. user clicks image button > page postback and original image above text box changes to imagebutton image

     
    Now i know i have to raise an event but i have no real idea how to do this. Does anyone have any examples of raising events and dynamic user controls?
     

    Wednesday, July 16, 2008 6:52 AM

All replies

  • User312496708 posted

    You need to recreate the dynamic controls in every page load and also create and bind the event handler in the page load this will make the eventhandler be called when the button is clicked

    Wednesday, July 16, 2008 7:01 AM
  • User2045693258 posted

    ok, i've had a look at your suggestion. I'm already recreating the controls in every page load. where do i add the event handler. in the usercontrol.ascx file or my host page? if i put them in the host page how do i find out which imageButton has been clicked in my user control? 

    Wednesday, July 16, 2008 7:35 AM
  • User2045693258 posted

    ok, i've had a look at your suggestion. I'm already recreating the controls in every page load. where do i add the event handler. in the usercontrol.ascx file or my host page? if i put them in the host page how do i find out which imageButton has been clicked in my user control? 

    Wednesday, July 16, 2008 7:53 AM