I am writing an ASP.NET project in C #.
The UpdateUserInfo.aspx page consists of text fields and buttons. In the pageLoad () method, I set some text in the text field, and when the button rings, I get the new value of the text field and write it to the database.
The problem even is that I changed the value of the textbox textbox.Text () method returns the old value of textbox ("sometext") and writes it to the DB.
Here are the methods:
protected void Page_Load(object sender, EventArgs e) { textbox.text = "sometext"; } void Btn_Click(Object sender,EventArgs e) { String textbox_text = textbox.text();
So, how to make the text box appear with some value initially, but when the user changes this value, the getText method returns the new changed value and writes it to the DB?
source share