Query String Question

Discussion in 'ASP General' started by Matt, May 26, 2004.

  1. Matt

    Matt Guest

    I always see people do something like that, and when the link is clicked, it
    will open a new page.

    <P><a href="profile.asp?id=493">Item 1<a>
    <P><a href="profile.asp?id=495">Item 2<a>
    <P><a href="profile.asp?id=497">Item 3<a>

    I want to know if is implemented in this way:

    In profile.asp

    <% If Request.Form("id") = "493" %>
    contents for item1
    <% ElseIf Request.Form("id") = "495" %>
    contents for item2
    //etc...??

    We put all contents in profile.asp, and open different one based on the
    query string value for id?

    please advise. Thanks!!
    Matt, May 26, 2004
    #1
    1. Advertising

  2. Matt

    Patrice Guest

    It uses Request.QueryString instead of Request.Form.

    It's likely that the content is taken from a database using the id.
    Basically :

    Set rst=GetRecordset("SELECT * FROM Products WHERE id=" &
    RequesT.QueryString("id"))
    Response.Write rst("Title") & "<br>"
    Response.Write rst("Description") & "<br>"
    Response.Write rst("UnitPrice") & "<br>"

    etc...

    "Matt" <> a écrit dans le message de
    news:...
    > I always see people do something like that, and when the link is clicked,

    it
    > will open a new page.
    >
    > <P><a href="profile.asp?id=493">Item 1<a>
    > <P><a href="profile.asp?id=495">Item 2<a>
    > <P><a href="profile.asp?id=497">Item 3<a>
    >
    > I want to know if is implemented in this way:
    >
    > In profile.asp
    >
    > <% If Request.Form("id") = "493" %>
    > contents for item1
    > <% ElseIf Request.Form("id") = "495" %>
    > contents for item2
    > //etc...??
    >
    > We put all contents in profile.asp, and open different one based on the
    > query string value for id?
    >
    > please advise. Thanks!!
    >
    >
    >
    Patrice, May 26, 2004
    #2
    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. Learner
    Replies:
    1
    Views:
    983
    Marina Levit [MVP]
    Jan 30, 2006
  2. Anonymous
    Replies:
    0
    Views:
    1,455
    Anonymous
    Oct 13, 2005
  3. =?Utf-8?B?SnVsaWEgQg==?=

    Date string problem in query string when posting back

    =?Utf-8?B?SnVsaWEgQg==?=, Aug 29, 2007, in forum: ASP .Net
    Replies:
    5
    Views:
    563
    =?Utf-8?B?SnVsaWEgQg==?=
    Aug 29, 2007
  4. roadrunner
    Replies:
    1
    Views:
    233
    Gunnar Hjalmarsson
    Feb 8, 2006
  5. nick
    Replies:
    1
    Views:
    450
    David Mark
    Feb 13, 2011
Loading...

Share This Page