Detect changed textbox,dropdown or link on Asp.net page and record on Log table.

Sudhanshum
Sudhanshum used Ask the Experts™
on
I have asp.net website and I want to record changed field in to log table, for eg. That page has 20 textbox then I want to know which field User changed out of 20, so I can maintain
that in log table, Please let me know
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Geoff SuttonSr. Software Developer

Commented:
If you are willing to wait for postback you can add a function to the OnTextChanged (for the Textbox) to the control (double click the control in the design mode will create that function) then on the server side just update your log file with what Textbox it was and what the new value is.

Doing it all with JavaScript on the client side is much the same.  In the control definition add onChange = functionName then create the JavaScript function to update your log, likely using an AJAX callback.

Author

Commented:
What i want to do is not doing postback on textbox entry, just it should maintain which textbox was changed, and when I will click on button click(postback) then it should fetch all changed textbox records and then put that on Log table. Is it feasible?
Geoff SuttonSr. Software Developer

Commented:
Turn off the autoPostBack feature on the Textbox.  Then it will call the changed event when the button is clicked.

Author

Commented:
are you saying to apply textbox change to every textbox? If Yes then how I will notedown which textbox is changed?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial