RE: http://aspsnippets.com/Articles/Server-Side-Code-Behind-Yes-No-Confirmation-Message-Box-in-ASPNet.aspx
In the above page, the button fires the javascript first, then the code-behind sub runs. The problem I have is I am in the middle of a code-behind sub routine that checks if a user is logged on the a PC. If there is a users logged on, I want the confirm popup to ask whether to reboot anyway or cancel. The code needs to dictate whether to call the javascript, not some direct button click. Then I need the remainder of the code-behind sub to execute based on the users choice.
I can call the client script in the code-behind sub using 'RegisterStartupScript...'; then I can get the page's form value. The problem is that the sub runs to completion without waiting for the javascript code to run. This causes code-behind variable to get checked before it's set by the client and it nevers works.
I know this topic has gotten a lot of postings over the last 2 years, but I have yet to see anyone show an example the way I'm needing. Any light you be able to share would be greatly appreciated.
Thank you,
Richard