Parsing Parameters not working

Discussion in 'ASP General' started by Peter Bassett, Aug 5, 2003.

  1. For some reason when I call one ASP program from another, I am not parsing
    out the parameters correctly.

    Caling ASP has
    <a href="foo.asp?to=?id=A1234?title=Sales?code=HR">blah</a>

    In the called ASP, I write this:
    response.write("Unparsed: " & Request.QueryString)
    response.write("To = " & Request.QueryString("to"))
    response.write("Title = " & Request.QueryString("title"))
    response.write("Code = " & Request.QueryString("code"))
    response.write("ID = " & Request.QueryString("id"))

    Output is:
    Unparsed: to=?id=A1234?title=Sales?code=HR
    To = ?id=A1234?title=Sales?code=HR
    Title =
    Code =
    ID =

    Am I crazy or should Title, Code, and ID NOT be empty. I am missing
    something obvious here. Please help!

    Thanks!
    Pete
    Peter Bassett, Aug 5, 2003
    #1
    1. Advertising

  2. Peter Bassett

    Alan Guest

    Your first querystring term should be prefixed with a '?', subsequent terms
    prefixed with '&'.

    Try this:

    <a href="foo.asp?to=&id=A1234&title=Sales&code=HR">blah</a>

    Alan

    "Peter Bassett" <> wrote in message
    news:Xns93CDDE886BAF5pbassett2223comcastn@204.127.204.17...
    > For some reason when I call one ASP program from another, I am not parsing
    > out the parameters correctly.
    >
    > Caling ASP has
    > <a href="foo.asp?to=?id=A1234?title=Sales?code=HR">blah</a>
    >
    > In the called ASP, I write this:
    > response.write("Unparsed: " & Request.QueryString)
    > response.write("To = " & Request.QueryString("to"))
    > response.write("Title = " & Request.QueryString("title"))
    > response.write("Code = " & Request.QueryString("code"))
    > response.write("ID = " & Request.QueryString("id"))
    >
    > Output is:
    > Unparsed: to=?id=A1234?title=Sales?code=HR
    > To = ?id=A1234?title=Sales?code=HR
    > Title =
    > Code =
    > ID =
    >
    > Am I crazy or should Title, Code, and ID NOT be empty. I am missing
    > something obvious here. Please help!
    >
    > Thanks!
    > Pete
    Alan, Aug 5, 2003
    #2
    1. Advertising

  3. Peter Bassett

    Ray at Guest

    Yes, it is obvious. ;] You want to separate your querystring parameters
    with a &, not a ?.

    A href="foo.asp?to=name&id=A1234&title=Sales&code=HR"

    Ray at home

    --
    Will trade ASP help for SQL Server help


    "Peter Bassett" <> wrote in message
    news:Xns93CDDE886BAF5pbassett2223comcastn@204.127.204.17...
    > For some reason when I call one ASP program from another, I am not parsing
    > out the parameters correctly.
    >
    > Caling ASP has
    > <a href="foo.asp?to=?id=A1234?title=Sales?code=HR">blah</a>
    >
    > In the called ASP, I write this:
    > response.write("Unparsed: " & Request.QueryString)
    > response.write("To = " & Request.QueryString("to"))
    > response.write("Title = " & Request.QueryString("title"))
    > response.write("Code = " & Request.QueryString("code"))
    > response.write("ID = " & Request.QueryString("id"))
    >
    > Output is:
    > Unparsed: to=?id=A1234?title=Sales?code=HR
    > To = ?id=A1234?title=Sales?code=HR
    > Title =
    > Code =
    > ID =
    >
    > Am I crazy or should Title, Code, and ID NOT be empty. I am missing
    > something obvious here. Please help!
    >
    > Thanks!
    > Pete
    Ray at, Aug 5, 2003
    #3
  4. Thanks - I've been working too long today!

    Pete


    "Alan" <> wrote in
    news::

    > Your first querystring term should be prefixed with a '?', subsequent
    > terms prefixed with '&'.
    >
    > Try this:
    >
    > <a
    > href="foo.asp?to=&id=A1234&title=Sales&code=HR">blah</a>
    >
    > Alan
    >
    > "Peter Bassett" <> wrote in message
    > news:Xns93CDDE886BAF5pbassett2223comcastn@204.127.204.17...
    >> For some reason when I call one ASP program from another, I am not
    >> parsing out the parameters correctly.
    >>
    >> Caling ASP has
    >> <a
    >> href="foo.asp?to=?id=A1234?title=Sales?code=HR">blah</a>
    >>
    >> In the called ASP, I write this:
    >> response.write("Unparsed: " & Request.QueryString)
    >> response.write("To = " & Request.QueryString("to"))
    >> response.write("Title = " & Request.QueryString("title"))
    >> response.write("Code = " & Request.QueryString("code"))
    >> response.write("ID = " & Request.QueryString("id"))
    >>
    >> Output is:
    >> Unparsed: to=?id=A1234?title=Sales?code=HR
    >> To = ?id=A1234?title=Sales?code=HR
    >> Title =
    >> Code =
    >> ID =
    >>
    >> Am I crazy or should Title, Code, and ID NOT be empty. I am missing
    >> something obvious here. Please help!
    >>
    >> Thanks!
    >> Pete

    >
    >
    >
    Peter Bassett, Aug 5, 2003
    #4
    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. John
    Replies:
    2
    Views:
    2,047
  2. Priyanka AGARWAL
    Replies:
    9
    Views:
    9,962
    Gordon Beaton
    May 25, 2004
  3. Jonck van der Kogel
    Replies:
    2
    Views:
    973
    Jonck van der Kogel
    May 27, 2004
  4. Jason
    Replies:
    2
    Views:
    503
    Jonathan Mcdougall
    May 13, 2006
  5. Charts

    output parameters not working in if return resultset

    Charts, Nov 2, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    3
    Views:
    411
    Steven Cheng[MSFT]
    Nov 4, 2005
Loading...

Share This Page