how to trace the textbox when the value is modified
-
Hi all, I have number of textboxes on a form and a submit button. the form allows the user to change existing data in the database. when a textbox is modified, i need to capture the changes done by the user and update the collection i've used to populate the text boxes and then to use the updated collection to update the database. How to trace which textbox value is changed.i need to update only the values changed. Plz give suggestions.. Thanks in Advance,
cheers sangeet
-
Hi all, I have number of textboxes on a form and a submit button. the form allows the user to change existing data in the database. when a textbox is modified, i need to capture the changes done by the user and update the collection i've used to populate the text boxes and then to use the updated collection to update the database. How to trace which textbox value is changed.i need to update only the values changed. Plz give suggestions.. Thanks in Advance,
cheers sangeet
I think one way is to crate a base class that drives TextBox class and implement OnTextChanged method in that class
public sealed class CustomTextBoxOnTextChanged : System.Web.UI.WebControls.TextBox { private bool isDirty = false; protected override void OnTextChanged(System.EventArgs e) { // Call the base OnTextChanged method. base.OnTextChanged(e); // Change the dirty flag to True. isDirty = true; } }
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "