I am making a form that should update data.
well when update button is clicked the database is update,but with the same old data that was found when the page loaded, even if the text fields text changes it still save the same old data that was there at loading.
I don't know what going on.
please help me.
Thanks in advance

You have not specified a postback event. To preserve data, you need this in your page_load, otherwise everytime your page goes back to the server, page_load will fire everything within its contents, which resets your textboxes to the original data.

If Not Page.IsPostBack Then
'load your data here to the fields
End If


c#

if (!IsPostBack) {

}

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.