Groups | Blog | Home
all groups > inetserver asp general > august 2003 >

inetserver asp general : Request.Form("Field Name") Versus Request.QueryString("Field Name")


John Davis
8/17/2003 9:38:40 PM
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

Dave Anderson
8/18/2003 12:00:43 AM
[quoted text, click to view]

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".



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use of
this email address implies consent to these terms.

Ken Schaefer
8/18/2003 2:54:22 PM
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

[quoted text, click to view]
: 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
:
:

AddThis Social Bookmark Button