Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Page is dirty information

Reply
Thread Tools

Page is dirty information

 
 
EDom
Guest
Posts: n/a
 
      08-09-2005
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


 
Reply With Quote
 
 
 
 
Donald Welker
Guest
Posts: n/a
 
      08-09-2005
You need to capture changed value events, then modify and save the dataset
before rebinding the controls. Load your old dataset in Page_Load. When the
TextChanged event fires for your textbox you can either update the dataset
then or set a flag to do it later. For the datagrid you either handle
EditItem update events or scavenge the entire datagrid for changed values.
Then in Page_PreRender you call code to save the changed dataset just before
binding the controls to their values.

You probably want to make sure the save succeeds before binding the data;
I normally just reload dataset right after saving it to make sure, but you
can do that conditionally if performance matters. BTW I recently read an
article by Scott Mitchell entitled "Why I Don't Use DataSets in My ASP.NET
Applications" -- you might want to take a look at it:
http://aspnet.4guysfromrolla.com/articles/050405-1.aspx

"EDom" wrote:

> 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
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dirty word filter function has a problem bay_dar@yahoo.com ASP .Net 3 03-20-2006 09:14 PM
Page is Dirty information EDom ASP .Net 1 08-23-2005 08:43 AM
Dirty Arrays and how to clean them up! spamm@realconsultants.com Perl 4 03-12-2005 09:49 PM
Is instanceof dirty? DeMarcus Java 26 11-10-2004 05:10 PM
Set DataGridItem dirty =?Utf-8?B?U2hhd24=?= ASP .Net 0 09-07-2004 08:05 AM



Advertisments