Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted
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

Posted

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

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...