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,
JohnYour 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.
"John Spiegel" <jspiegel@.YETANOTHERSPAMHATERc-comld.com> wrote in message
news:OgWT8hZ8EHA.1452@.TK2MSFTNGP11.phx.gbl...
> 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
>
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
"John Spiegel" <jspiegel@.YETANOTHERSPAMHATERc-comld.com> wrote in message
news:OgWT8hZ8EHA.1452@.TK2MSFTNGP11.phx.gbl...
> 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
>
Hi John,
I keep the following bookmark handy, when I need to work more closely with
the execution lifecycle:
http://msdn.microsoft.com/library/d...onLifecycle.asp
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
"John Spiegel" <jspiegel@.YETANOTHERSPAMHATERc-comld.com> wrote in message
news:OgWT8hZ8EHA.1452@.TK2MSFTNGP11.phx.gbl...
> 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
>
Thanks, all! One problem down, 3.2 million to go <g>.
"John Spiegel" <jspiegel@.YETANOTHERSPAMHATERc-comld.com> wrote in message
news:OgWT8hZ8EHA.1452@.TK2MSFTNGP11.phx.gbl...
> 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
>
0 comments:
Post a Comment