|
-
September 24th, 2009, 04:56 PM
#1
Problem with Button Click Events when set during postback
I have a dynamically created DataList control (within a composite control) that contains ImageButtons. I set button click events for these buttons during the DataBind() call (in the ItemCreated callback). This works fine on the first pass.
However:
When one of these buttons is clicked, I need to reconfigure the DataList (and re-assign the button click events). At this point of the page cycle the DataList has already been constructed via normal page/control initialization, and I need to rebuild it. I have used various approaches to no avail, ranging from attempting to "clear" the DataList via nulling out the datasource, re-binding it, and then rebuilding it to completely removing the composite control and reconstructing it. Regardless of how I go about this, the newly constructed data list always builds, displays, scrolls, and post back properly upon button click, but the "button click" events no longer execute (even though the events are added during the reconstruction).
Any help is appreciated; thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|