0

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.

Val Akkapeddi
  • 1,173
  • 10
  • 17
Hiren
  • 1,381
  • 5
  • 24
  • 41
  • I don't fully understand if your problem is storing the data into database, or allowing the user to press backspace. Also you are storing every change the user does? – gbianchi Mar 06 '12 at 17:42
  • Yes sir,I want to store my data in table with textbox change event,I don't want button for it. – Hiren Mar 06 '12 at 17:44
  • Also agree with @ gbianchi. Don't clearly understand what you mean, please. – Lion Mar 06 '12 at 17:49
  • In simple way I want to run my TextBoxChanged event without interrupting other operations of my page – Hiren Mar 06 '12 at 18:05

1 Answers1

0

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.

Community
  • 1
  • 1
Justin Pihony
  • 66,056
  • 18
  • 147
  • 180