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

Discussion in 'ASP General' started by John Davis, Aug 18, 2003.

  1. John Davis

    John Davis Guest

    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
     
    John Davis, Aug 18, 2003
    #1
    1. Advertising

  2. John Davis

    Ken Schaefer Guest

    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

    "John Davis" <> wrote in message
    news:...
    : 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
    :
    :
     
    Ken Schaefer, Aug 18, 2003
    #2
    1. Advertising

  3. "John Davis" wrote:
    >
    > 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".



    --
    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.
     
    Dave Anderson, Aug 18, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matthew Louden
    Replies:
    1
    Views:
    7,005
    Scott M.
    Oct 11, 2003
  2. George
    Replies:
    5
    Views:
    6,647
    George
    Apr 2, 2004
  3. Russ

    script versus code versus ?

    Russ, Jun 10, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,522
  4. Christoffer Sawicki
    Replies:
    5
    Views:
    273
    Christoffer Sawicki
    Sep 2, 2006
  5. Paul Butcher
    Replies:
    12
    Views:
    752
    Gary Wright
    Nov 28, 2007
Loading...

Share This Page