Working on an asp.net project using VB.NET
On my page I have a set of textboxes which displays DB stored information relevant to the logged in user. This is displayed on page load. The extracted information is stored in a datatable then populates the relevant textboxes
I have a button that once clicked, lets the user update changes made to the values in the textboxes
However, this update does not work. On the update button click the textbox values just revert back to the old values and no changes are even written to the database.
When I comment out the code on page load that fills the textboxes however, the update then works.
Any ideas on getting round this problem to let the update work with the on load code present would be great.
hi...please put ur code for load data to textboxes with in below code beacuse every time when button click or any events fire the page will reload
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
if not IsPostBack then
'call ur code for load data to textboxes
then u can call ur function in update button click....
Page load code will run whenever a button will be clicked, so you can try pasting all the code that is in Page_Load event
inside the condition like:
If !Page.IsPostBack Then
//Your Code Here
Thankyou Usman, This solved the problem!