how to call my cmdSave_Click button to run from my javascript in aspx.
Ok so now it is working and now when the javascript actually function checkSave() runs and the window.confirm pops up, I want it to really save. Before I was being sure I got that far.
my Jscript runtime error Microsoft JScript runtime error: "window.document.frmTest' is null or not an object"
it errors on this line that is in the script below: window.document.frmTest.cmdSave();
I am NOT suprised, it is from cmdSave_Click() in my c# code behind page. How do I call that C# code behind event handler from Jscript?
Here is my javascript in my aspx page:
<script language="javascript" type="text/javascript">
var isDirty;
isDirty = 0;
function setDirty() {
isDirty = 1;
}
function checkSave() {
var sSave;
if (isDirty == 1) {
sSave = window.confirm("You have some changes that have not been saved. Click OK to save now or CANCEL to continue without saving.");
window.document.frmTest.cmdSave();
}
else
{
return true;
}
}
}
</script>
Thanks in advance!
Adam
Ok so now it is working and now when the javascript actually function checkSave() runs and the window.confirm pops up, I want it to really save. Before I was being sure I got that far.
my Jscript runtime error Microsoft JScript runtime error: "window.document.frmTest' is null or not an object"
it errors on this line that is in the script below: window.document.frmTest.cmdSave();
I am NOT suprised, it is from cmdSave_Click() in my c# code behind page. How do I call that C# code behind event handler from Jscript?
Here is my javascript in my aspx page:
<script language="javascript" type="text/javascript">
var isDirty;
isDirty = 0;
function setDirty() {
isDirty = 1;
}
function checkSave() {
var sSave;
if (isDirty == 1) {
sSave = window.confirm("You have some changes that have not been saved. Click OK to save now or CANCEL to continue without saving.");
window.document.frmTest.cmdSave();
}
else
{
return true;
}
}
}
</script>
Thanks in advance!
Adam