Hi,
I have a the following javascript code(see below) within my asp.net page,
I would like to be able to set the value of UnSavedChanges within my c#
behind code to indicate that changes have been made but not yet saved.
For Example I have a gridview rowUpdating event as follows
protected void gvwCommodity_RowUpdating(object sender,
GridViewUpdateEventArgs e)
{
}
Do you know of any way of kicking off the SetUnSavedChanges event within
this method or setting the UnSavedChanges variable any other way..
Thanx in advance
Robert
///Javascript code below
/// this code uses essential objects and works on the callback panel
onClientClick
// event
var UnSavedChanges
function SetUnSavedChanges(callBackPanel)
{
UnSavedChanges = true;
}
function SetSavedChanges(callBackPanel)
{
UnSavedChanges = false;
}
function AdminTabStripHandler(e, eventInfo)
{
if (UnSavedChanges == true)
{
var RetVal = confirm("Are you Sure you want to leave this screen
without saving changes");
if (RetVal == true)
{
SetSavedChanges();
}
return RetVal;
}
}