M
Mel
I am using the code below to prompt to save on exit of my asp.net page
but don't prompt when the Save button is clicked. However, I am using
a WebControls button for the Save button, so when the user clicks the
save button it runs the cmdSave_Click event server-side vb code.
Since I am using a web control, how do I fix this code to set the
needToConfirm variable correctly?
code below is from: http://www.4guysfromrolla.com/webtech/100604-1.shtml
<script language="JavaScript">
var needToConfirm = true;
window.onbeforeunload = confirmExit;
function confirmExit()
{
if (needToConfirm)
return message to display in dialog box;
}
</script>
....
<input type="Submit" value="Save" onclick="needToConfirm = false;" />
but don't prompt when the Save button is clicked. However, I am using
a WebControls button for the Save button, so when the user clicks the
save button it runs the cmdSave_Click event server-side vb code.
Since I am using a web control, how do I fix this code to set the
needToConfirm variable correctly?
code below is from: http://www.4guysfromrolla.com/webtech/100604-1.shtml
<script language="JavaScript">
var needToConfirm = true;
window.onbeforeunload = confirmExit;
function confirmExit()
{
if (needToConfirm)
return message to display in dialog box;
}
</script>
....
<input type="Submit" value="Save" onclick="needToConfirm = false;" />