I have a textbox on an ASP.NET 4.0 page. I can add text to the textbox in the code-behind and when the page renders, the text displays just fine. However, when I modify the textbox in the browser and submit the page, the MyTextBox.Text property still shows the original text and not the modifed text I entered in the browser. How can the code-behind show the modified text?
Share
You need to check for a postback in your initial textbox, like this:
You can set your textbox normally in the code behind for the submit button handler.