Pregunta

In an ASP.NET webform, I have 3 TextBoxes, each linked to a different SQL Database Table. Now I want to store data into table when Textbox Change event occurs. I can do successfully with make Update Query in TextBoxChanged event. Now What I want is when this update operation going on I dont want it to make interrupt my page and other operations I want to perform. I use an Asynchronous Postback from the TextBoxChanged event.

The problem that I am having with this is: When I change one TextBox and click on another TextBox, and hit "backspace" inside that textbox, the page reacts as if it was a browser back button-click, and redirect to other page.

I hope you can understand the question I want to perform TextBoxChanged and handle the asynchronous postback without interrupting other operations.

¿Fue útil?

Solución

You will have to use jQuery for the capturing of the textbox changing. However, you cannot connect directly to onchange as the changed value is not stored until after the event. You could probably tie to the blur event if you only want to capture when the user changes and leaves the textbox, though. Otherwise, you will have to use a timeout to continuously check if the value has changed ( How to detect a textbox's content has changed )

Within that event, you should use AJAX to make the save calls for persisting the value.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top