Question

I have 8 text boxes in a form. And each text box changed event the text in the text box should be saved to Database. Is there any better approach than firing each text box's text changed event.

Was it helpful?

Solution

  1. You could use only one event handler for all the text boxes and use the sender argument to get the changed text.

  2. You could put all of the textboxes in an UpdatePanel, so that the page is not refreshed even if you set AutoPostBack to true.

  3. You would write a PageMethod that receives the element to update and the updated text. This method could be called using AJAX and jQuery. This blog by Dave Ward should get you started.

OTHER TIPS

A possible approach is using the timer. Have a timer that ticks every 1000 ms (say) and checks the textBox.Text.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top