0

I am highlighting textboxes after somebody changes its text on my asp.net form. Currently I am using jquery, But unfortunately, the highlight will be removed after a postback in asp.net. Is there any way for the modified-text class to be persisted after postback? Will this affect perfomance if I use asp.net TextChanged event to highlight ?

 $('.form-content  input, .form-content textarea, .form-content select').change(function (e) {
      $(this).addClass('modified-textbox');
 });
Jaimin Soni
  • 1,061
  • 1
  • 13
  • 29
Yesudass Moses
  • 1,841
  • 3
  • 27
  • 63

1 Answers1

1

Keep the initial value on the server. On postback compare the initial and the new values. If they are different, add your class to the textbox.

You can do it on text changed but the performance depends on what asynchronous postback technology are you using.

puzzler
  • 218
  • 3
  • 13