Question : ASP.Net / AJAX - Page IsDirty

Hi..
Can someone recommend an implememtation of a isDirty Panel / Control or code - that can be placed on a web page to prompt the user when they navigate away from a page without saving?
I found basic versions but none seem to work with grids. They all seem to to just monitor if text fields values have been changed. I'm using ajax which It assume may complicate things.
Thanks in advance

http://www.codeproject.com/KB/ajax/ajaxdirtypanelextender.aspx

http://aspnet.4guysfromrolla.com/articles/101304-1.aspx


Answer : ASP.Net / AJAX - Page IsDirty

The code project one looks quite good but does not appear to have any tollerance for controls that have their own child controls.

To make it work with the datagrids Child Controls that have their own Child Controls, you will need to add the following:

                else if (control.HasControls)
                {
                    values.AddRange(GetValuesArray(control.Controls));
                }

at the end of the if statement on the GetValuesArray method.

WARNING: You are creating a recursive loop! This is sometimes bad practice, but in this case should be safe.
Random Solutions  
 
programming4us programming4us