Request.Form("Field Name") Versus Request.QueryString("Field Name")

J

John Davis

I want to know what's the differences between
Request.Form("Field Name") and
Request.QueryString("Field Name")

OR they function exactly the same, which is to return the value of the
field??

Thanks,
John
 
K

Ken Schaefer

This is a simplistic explanation:
If the HTTP request method is POST, the user submitted data is in the
Request.Form() collection
If the HTTP request method is GET, then user submitted data is in the
Request.QueryString() collection

However, you can still do:

<form method="post" action="page.asp?data=value">
<input type="text" name="txtName" value="Name">
</form>

and
Request.Form("txtName") will contain "Name"
-and-
Request.QueryString("data") will contain "value"

Cheers
Ken

: I want to know what's the differences between
: Request.Form("Field Name") and
: Request.QueryString("Field Name")
:
: OR they function exactly the same, which is to return the value of the
: field??
:
: Thanks,
: John
:
:
 
D

Dave Anderson

John Davis said:
I want to know what's the differences between
Request.Form("Field Name") and
Request.QueryString("Field Name")

They refer to objects in two different collections, each of which may be present
in a request.

From a practical standpoint, the former captures data from forms with METHOD
"post", and the latter with METHOD is "get".
 

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

No members online now.

Forum statistics

Threads
474,266
Messages
2,571,083
Members
48,773
Latest member
Kaybee

Latest Threads

Top