Kevin,
In general I don't do any particular work in page_load, but in this case I
have no choice. I'm adding checkboxes dynamically to my page and in order
to display them after a postback I have to re-create all of them. As far as
I know I have to do this in page_load. I tried doing it in
toolbar_save_ButtonClick(), but the checkboxes' state were no longer
available in ViewState. The reason why I want to know -in page_load- which
button was clicked, is because re-creation of the checkboxes is dependent on
which button is clicked, and since I can't re-create them in the buttons
click event I have to know this in page_load.
Shawn
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
Write an Event Handler for the ToolBarButton's click event. It isn't
necessary to use the Page_Load Sub to do all the work in your Page. In
fact, it isn't necessarily a good idea to do anything in particular in that Sub.
The Sub is for the purpose of executing processes that must run when the
Page loads. There are plenty of other events and methods for doing things
in a Page. See:
http://msdn.microsoft.com/library/de...nLifecycle.asp
--
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.
"Shawn" <bo********@hotmail.com> wrote in message
news:uQ*************@TK2MSFTNGP12.phx.gbl... Hi.
I have a ToolBar with a couple of ToolBarButtons. On postback after
clicking on of the buttons Page_Load is called first then the
ToolBarButton's click event is called. Is there anyway for me to check
in Page_Load which of the buttons have been clicked?
Thanks,
Shawn