Determining if an event WILL be fired

OnTheAnvil

Regular
Joined
Nov 4, 2003
Messages
92
Location
Columbus, Ohio, USA
On my Page_Load event I want to test to see if a user clicked the Save button. Or another way of saying this is during the Page_Load I want to see if the btnSave_OnClick event is going to fire sometime after the Page_Load event. Is there any way to do this. Maybe looking through some events object or queue?

Thanks,
OnTheAnvil
 
Out of curiosity - why? Wouldn't it be easier to handle the event in the button click itself rather than the page load?
It may help if you give a bit more detail about what you are trying to do as there be a better way.
 
Visual Basic:
dim thisbool as boolean

private sub page_load()
thisbool = true
end sub

private sub button_click()
if thisbool = true then
whatever()
end if
end sub
 
Thanks for the suggestion TheNerd but that is actually the reverse of what I want.

Damp, on my page I have a grid that has checkboxes in one column. Users check various boxes and click Save. Depending on other conditions on the page I sometimes need to call a function to completely repopulate the grid(gridRefresh) during the page load ( and yes it does need to happen on the page load not the page_prerender). When I do this it destroys any information about the state of the checkboxes. If I've done the gridRefresh on the page load and then the the btnSave_OnClick event fires it believes that no checkboxes where checked because the gridRefresh has cleared the state of the grid. I can probably come up with an elaborate work around for this but if I just knew if the btnSave_OnClick was going to be called I could simply not call gridRefresh. Let me know if you need more info.

Thanks
 
I forgot to mention that I can always set a variable using javascript depending on what button is clicked and check that in the Page_Load event but again I'd rather find a simpler way to do this. Sometimes it would just be useful to know what else is still going to happen before the page gets sent back to the client.
 
Back
Top