Update problem

ultraman

Well-known member
Joined
Dec 31, 1969
Messages
138
Location
Quebec, Canada
This is weird ! I m trying to update the DB with the values in the TextBoxes of my page. Theyre filled with the existing Data in the Load event. But when I submit the values, it doesnt matter whats inside the TextBox, the values always stays the same ? I test when I press the button (cmd_Click event), and the value of the txtTest.Text is the old one, not the one written ?

Does anyone have an idea why ?
 
It sounds like you are calling the wrong method in the routine that calls the update. Maybe post the code that is being called and we can take a better look?
 
Check your "Page_load" event, because every time this event will fire before your "button_Click" event.

You can use "IsPostBack" to avoid this problem.
 
Why dont you try the following in the Page_Load event.
Code:
Dim s as string =Request.Form("txtTest")
Response.Write(s)
 
Back
Top