Adding Client-side Javascript to a Wizard Control SideBarButton

D

daSharp

I would like to add a javascript function call to the SideBarButton in an
ASP:Wizard control in ASP 3.5.

I have a onbeforeunload function defined that I do not want to execute
everytime the user clicks on a menu item in the sidebar. It should only be
called when the user closes the web page. I would like to set a var when the
user clicks a menu item that the onbeforeunload function can evaluate and
know to skip the onbeforeunload function for this postback.

This is the javascript on the webpage:

<script type="text/javascript">

var IGNORE_UNLOAD = false;

function doBeforeUnload()
{
if (IGNORE_UNLOAD = false)
{
document.getElementById('<%=btnLogout.ClientID %>').click();
//Call the hidden logout button click event ;
}
}

if(window.body)
window.body.onbeforeunload = doBeforeUnload; // IE
else
window.onbeforeunload = doBeforeUnload; // FX
</script>

I need a way to set the var IGNORE_UNLOAD = true from a menu click in the
wizard.

Thanks.

Don Sharp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top