Sequence of events

  • Thread starter Thread starter John Spiegel
  • Start date Start date
J

John Spiegel

Hi all,

I've got an aspx page with a Web user control and (among other things) a
submit button. When the form is submitted, the same page is to be served
back up, but with some items changed, mainly a panel visible that had not
been and a setting in the user control. The problem I'm having is figuring
out how to manipulate the flagging values as the submit's handler doesn't
fire until the page and controls' load methods. I'm a bit fuzzy on the
firing order of methods between objects, but am I better off moving such
code to the PreRender methods?

TIA,

John
 
Your button click event handler should contain the code to flip the
visibility of the panel. The Page_Load code should only contain code that
should execute no matter what.
 
Yes, moving the code to PreRender is a good idea. It is not always possible,
especially if what has been clicked affects databinding, but, if it is not a
case, go for it. You can't change event sequence.

Eliyahu
 
Back
Top