Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Catch changes in a web form

Status
Not open for further replies.

liuk

Programmer
Jan 16, 2006
54
IT
hi,
in my web application i would like to catch any changes the user makes on the form . One way should be to handle all events for the webcomponent in the page, but is there another way( at page level) ?
thanks.
 
not directly, but u could maybe loop through the controls that the page has and add handlers to the controls???

Known is handfull, Unknown is worldfull
 
Depending on how you've set the data on your form (e.g. Bound vs Unbound) you may be able to use the HasChanges method of a DataSet.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
yes, my controls are bounded.

For example, i have a dropdownlist and a textbox.
I fill them with data retrieved from the DB.
when the user click the SAVE button, i read back the current data and pass them to an update stored.

If the user select another item in ddl or modify the textbox' content, i'd like to have some way to "efficiently" notify me that a change occurred.

how can i do that with dataset? I think i should update my dataset first each time user changes something and then check the HasChanges property, but this means i have to handle all control's "OnChange" event. Am i wrong?

 
One method would be to use the database itself (i.e. use a trigger that fires each time the record is updated and then fire an email off to you if data has changed). Sometime I don't like this method though as it tends to consist of having application code within the database but I guess it's up to you on which method you use.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
thank you for the answer.

Probably i was not clear when i said "notify a change has occurred". I just need to know, before execute the save method, if some data are changed .
Till now i set a IsChanged property on each OnChange event, but i was wondering if is there another solution ( a "best practice") in this case.

thank you very much, anyway
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top