ASP – POSTing

By dorms

Post data from one page to another.

When posting data to a page we are requesting that page, in other words, the page is requested.

default.asp

<form name=”employeeForm” method=”post” action=”page1.asp”>
<input name=”txtName” type=”text” value=”Bob” />
<input type=”submit” name=”btnOK” value=”OK” />
</form>

page1.asp

<%
‘ Response.Write(Request(”txtName”))

‘ name = Request.Form(”txtName”)
‘ name = Request(”txtName”)

‘ Response.Write(name)

Response.Write(”<br /> Request.Form(txtName) = ” & Request.Form(”txtName”))
Response.Write(”<br /> Request(txtName) = ” & Request(”txtName”))
%>

Both Request.Form(txtName) and Request(txtName) are the same.

Leave a Reply