Forum Moderators: open
dim newValue as string=textboxNewName.text please suggest me what I am doing wrong. :tntworth:
In the first instace, are you populating the Textbox from the OnLoad event? If this is the case then you must realise that the onload event gets called before the onclick event. Like this...
1. Onload is called, and the texbox gets populated with "foo"
2. The user replaces the textbox with "bar" and presses the submit button causing a postback.
3 Onload is called, and the texbox gets populated with "foo"
4 Onclick is called and the database gets updated with the textbox contents ("foo")
You need to remove step 3, possibly by checking the Page.IsPostback method.