I have a simple working grid that allows user to enter data into the grid, and then click a button to save all the data in the grid.
In the same page, there is another button which belongs to the master page that will access the saved data in the grid.
The problem is when the user has entered all the data in the grid and forgot to save the data, and then does one of the followings:
1. Click the master page button
2. Navigate to another page
All the user entered data will be lost.
My question is that Is there any way to notify the user he/she is about to lose the just entered data?
Any help is appreciated.
Hi,
You can try this in the javascript,
var
IsDataDirty = false
window.onbeforeunload =
)
{
;
}
.returnValue = message;
message;
function AfterCellUpdate(gridName,cellId)
IsDataDirty =
Hello,
Thanks for sharing -- I really did not think about the AfterCellUpdating event -- this might be exactly what you need. Setting a global IsDirty flag in this client-side event seems like a great idea.
Thanks a lot for sharing.