I have a form on a page with validation that the required data has been entered. If all the data has been entered it gets written to my database otherwise I display a message in the form which data is missing.
The problem is when I return to the page using response.redirect all the fields in the form have been reset. How do I prevent this from happening?
Well, I'm not an ASP.NET expert (yet). I still use Classic ASP. The way I would handle that is with session variables. When the data is submitted, gather it up into a session variable.
Session("FirstName") = Request("FirstName")
Now if you have to redirect them back to the form because of bad data, make those session variables the VALUEs in the fields.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Active Server Pages Forum.