We help IT Professionals succeed at work.

Aspnet Textbox wont update

ITDeptAtPCS asked
Last Modified: 2012-05-08
I have a page with several textboxes and the textboxes are bound to a dataset. On the on_click button event to send the changes that a user makes to the textboxes, a stored procedure is called and the text of each of the textboxes is passed as parameter values to the stored procedure; however the new data for the textboxes are not been passed to the database. Using sql-profiler I see that as soon as the submit button is hit and the on_click event activates, the value of each of the textbox rolls back to their previous value and the new value are NOT passed to the update stored procedure. What in asp.net could be causing textboxes to not hold their new values during an update?
Watch Question

This sounds like you are populating the values for the TextBoxes on Page_Load... so when you click the button it re-populates them ('cause the page is re-loading)...
The trick is to populate them like this:
If Not IsPostback then
      'Populate TextBoxes
End If
This one is on us!
(Get your first solution completely free - no credit card required)
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.