• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Page State

As I said before, the web server doesn’t care about user information or condition. If you were creating a form that would post back to itself, it would be your job as a designer to maintain the information a user entered into the form across posts; otherwise, the information the user inserted would be lost when the page was delivered back. The following is a simple example of this in traditional ASP.

Traditional ASP—trad_page_stat.asp

<%@LANGUAGE="VBSCRIPT"%> 
<%dim vFirstName,vLastName,vPhone,vEmail 
vFirstName = "" 
vLastName = "" 
vPhone = "" 
vEmail = "" 

if Request.Form("submit") <> "" then 
    vFirstName = Request.Form("firstname")
						vLastName = Request.Form("lastname")
						vPhone = Request.Form("phone")
						vEmail = Request.Form("email") 
end if 
%> 
<html> 
<head> 
<title>Traditional ASP - Page State</title> 
</head> 
<body> 
<form name="form1" method="post" action=""> 
    <input type="text" name="firstname" value="<%=vFirstName%>"> 
    First Name<br> 
    <input type="text" name="lastname" value="<%=vLastName%>"> 
    Last Name<br> 
    <input type="text" name="phone" value="<%=vPhone%>"> 
    Phone Number<br> 
    <input type="text" name="email" value="<%=vEmail%>"> 
    Email Address<br> 
    <input type="submit" name="Submit" value="Submit"> 
</form> 
</body> 
</html> 

					  


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint