Author: asolds | Posted on: 11/18/2008 4:09:52 PM | Views : 351

Does anyone know how to get the TextChanged event to fire when a user deletes all of the text from a TextBox?  I know I can do this with JavaScript, but I would prefer not to.  I'm still learning asp.net, but I do not understand why the TextChanged event doesn't fire in this instance.  Ex.  The TextBox is empty.  The user input TEST in the TextBox and presses Enter or Tab - the TextChanged event fires as expected (in this case, it updates the record in the db).  Then, the user deletes the text in the TextBox, so now the TextBox is empty again, and the user presses Enter or Tab; however, the TextChanged event is not fired.  I would like it to fire, so the process to update the record, with a NULL value, would run.

Again, I hope I am just missing something easy and I do0n't have to rely on JavaScript, but if that is teh only/best way to catch it when the user deletes all of the text, then so be it - just hoping it isn't.

...

Go to the complete details ...