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.yqcomputer.com/
var needToConfirm = true;
window.onbeforeunload = confirmExit;
return message to display in dialog box;
<input type="Submit" value="Save" onclick="needToConfirm = false;" />