I am fairly new to asp.net, and have a problem with a page I am working on. The page contains some textboxes, and a button. When the button is clicked, the codebehind fetches the textbox contents. If the user did something wrong, he is redirected to the same page again, but before that the textbox contents is saved in the session. When the page loads again the textboxes are now filled with this sessiondata so the user doesent have to input all the data from scratch again. But when the button is clicked the second time, the textbox content I read is the old content, and not the new data the user has typed in. How come?
To make my problem a bit easier to understand:
1. Page loads
2. User types "John" in the name textbox, and fills out other textboxes
3. User clicks the submit button
4. Codebehind reads "john" from the name textbox
5. Codebehind registers an error from the other stuff the user has filled in, and redirects to the same page with all textbox contents saved in session
6. Page loads, and all textboxes are filled from the session data
7. User changes the text in the name textbox to "Joe"
8. User clicks submit
9. Codebehind reads "john" from the name textbox - How come?!
Really hope you can help me understand this!