Wednesday, March 28, 2012

Text Control value doesnt update

I have created an aspx page which onload populates a dataset then binds various controls to the relevant columns. Then on editing one of the text boxes on the click of a button I want to update the database. I have tried various updates but to no avail. I have narrowed the problem down to that on stepping through the code the value held in memory doesnt recognise that the text held in the control has changed from the original text. Any Ideas.If you are initialising your text box values in the Page_Load event, you must enclose your code in the following IF block:
If Not IsPostBack Then
'
' Initialisation code goes here...
'
End If
Worked a treat cheers, how simple but id never have guessed.

0 comments:

Post a Comment