Dataset dirty

  • Thread starter Thread starter EDom
  • Start date Start date
E

EDom

Hi,
On my page I have dataset values displayed in text box and datagrid. After I
make any change on the text boxes which do not immediately effect the value
in the dataset. How can I know if the dataset is dirty. I mean how can I
capture if any change was done to the values in the controls on the page to
prevent the user from escaping without saving changes

Regards
 
When you set the value for textbox using dataset same value will be assign to
on hidden field, using javascript you can validate this thing either using
body unload event or textbox onblur event.
"Note: If you are using asp:textbox control then on code behind file add
onblur attribute to your asp:textbox control"

Regards
 
Check out the has changes - or you can loop through the rows of each table
and check their rowstate - HasChanges is a little cleaner and less work ;-)

Debug.Assert(DataSetName.HasChanges, "There aren't any changes");
 
EdCom,

In my opinion can you never completly prevent that the user does not a
postback.

Therefore you should not leave it dirty if that is important however update
it at time.

Cor
 
Back
Top