Sequence of events

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
 
M

Marina

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.
 
E

Eliyahu Goldin

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top