Link to home
Start Free TrialLog in
Avatar of ITDeptAtPCS
ITDeptAtPCS

asked on

Aspnet Textbox wont update

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?
Avatar of Espavo
Espavo
Flag of South Africa image

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
Espavo
 
ASKER CERTIFIED SOLUTION
Avatar of chandrashekharnath
chandrashekharnath

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial