save post data without session variable?

S

SLH

i have an asp page with a form that posts to itself. (the action of the form
is the same page the form is on). i validate input and dont accept it if
there is something wrong with it. problem is that when the form is
submitted, and i display the error message, the data the user typed in the
box is gone. i work around this by setting a session variable as soon as the
user hits submit and store the data the user typed. then for the default
value of the textbox i have <%= Session("var") %> and that leaves the users
data in the box for them to edit. is there a better way i could do this?
 
A

Aaron Bertrand [SQL Server MVP]

<input type=text name=FieldName
value="<%=Server.HTMLEncode(Request.Form("FieldName"))%>">
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top