The Session[MadeChangesIndex] stores a boolean indicating if any changes have been made to the lists/data grids.
In the Page_Load() Handler added:
if((bool)Session[MadeChangesIndex])
Cancel_PB.Attributes.Add("onClick", "return(HandleCancel(true));");
else
Cancel_PB.Attributes.Add("onClick", "return(HandleCancel(false));");
In the HEAD tag of the HTML added:
function HandleCancel(ListChanged)
{
if(ListChanged)
return(confirm("Are you sure you want to Discard ALL of your Edits? This includes any changes to the Work Item, Participant and Client Lists."));
else
return(confirm("Are you sure you want to Discard ALL of your Edits?"));
}
Works Great!
What I'd like to do is figure out how to walk the elements of the form and determine if any of the controls have been modified and exit without confirmation if nothing has changed.
Subscribe to:
Post Comments (Atom)
C# Sucks!
JK!! Seriously, though, somewhere around C#-3 we should have inculcated ourselves with the question: "Does 'CAN' == 'SHOULD...
-
That pesky problem has reared its ugly head again! I remembered that its a permissions problem but forgot the wrinkle where you have to REMO...
-
Today I learned that it is possible to call private and protected methods by using reflection. This is a great technique for Unit Testing su...
No comments:
Post a Comment