|
Home > Archive > IIS ASP > May 2004 > Query String Question
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Query String Question
|
|
|
| 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 2004-05-30, 11:53 am |
| 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" <mattloude@hotmail.com> a écrit dans le message de
news:OxDW4UuQEHA.3708@TK2MSFTNGP10.phx.gbl...
> 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!!
>
>
>
|
|
|
|
|