|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Dynamically added WebControls requiring TWO clicks to fire event?!?and feel I am perhaps "almost there", I must be missing something small. Issue ------ I have an asp:table that I am dynamically adding imageButton controls to. After I add the image button to the row, I add an eventHandler to the control. Now the imageButton renders fine. Now when i click the image button, the event does _not_ fire.... BUT, if I click the exact same control a second time, the event handler fires. I have tried searching and researching and everything I've found leads to the page build order and suggestions I have read all refer to building the control in the page_init() rather than the page_load() event, which I have tried, yet I still get the same results. Here's the gist of the code... code ------ sub page_init() InitializeComponent() ' Call sub to dynamically build table and add controls loadMenus() end sub sub loadMenus() ' Build row... ' Create imageButton... ' Add imageButton to row... ' Add eventHandler to _command() of imageButton... ' Add row to table... end sub sub imageButton_command() ' Get command arguments to see which menuItem was clicked... ' store menuID and menuItemID in variables ' now call loadMenus again with my new ID's loadMenus() end sub Any help is greatly appreciated. -e
03 dropdownlist selectedindexchanged not firing in usercontrol on
Why no richtextbox in Web Controls? Can assign multiple keys to datkeys of datagrid htmlinputfile - accept Gridview, using Callbacks when Sorting and Paging textbox postback Div and code behind on click event dataformatstring for dates in datagrid Dyamically add user control, along with properties? can you convert an in-memory bitmap render in a web control image ? |
|||||||||||||||||||||||