I've run across a problem that I now understand the cause of, but have no idea how to resolve. I'm building controls on a form on the fly, based on a datareader's contents. It's dynamic, so I never know how many sets of controls that I'll need.
Basically, on pageLoad I put:
an image
a <ul>
a delete button
an update button
on the form.
The onclick event handler for the update goes to another page, so it's not an issue. My delete button, on the other hand does a submit.
I now understand that event handlers are process after pageLoad. This leaves me with a problem of the display being built before the delete eventhandler runs, so I'm always in a state of displaying one more set of controls than should be there.
Can someone tell me how I can place the delete event so that it processes before the pageLoad events? Can I check for the sender and act accordingly?
Basically, on pageLoad I put:
an image
a <ul>
a delete button
an update button
on the form.
The onclick event handler for the update goes to another page, so it's not an issue. My delete button, on the other hand does a submit.
I now understand that event handlers are process after pageLoad. This leaves me with a problem of the display being built before the delete eventhandler runs, so I'm always in a state of displaying one more set of controls than should be there.
Can someone tell me how I can place the delete event so that it processes before the pageLoad events? Can I check for the sender and act accordingly?