Forums

This topic is locked

ASP URL Request String Help

Posted 22 Feb 2007 12:38:45
1
has voted
22 Feb 2007 12:38:45 Paul Tucker posted:
Hello,

I am trying to populate a photo gallery web page with dynamic data. The input is coming from a jump menu on the previous page that is populated dynamically. When a user chooses a photographer from the jump menu I want the gallery_detail page to display thumbnails and image details for that photographer. I can get the URL to include a request string, ie. gallery_detail.asp?photographerID=102, but how can I use this to populate the page with the correct info from the database. Thanks for any help.

Regards

Paul

Replies

Replied 22 Feb 2007 20:18:45
22 Feb 2007 20:18:45 Jeremy Conn replied:
All you need to do is filter your recordset on the detail page with the same ID you pass in the URL.

<b>Jeremy Conn</b>
www.conncreativemedia.com
DW8 | ASP/VB/ASP.NET | Access/SQL
Replied 01 Mar 2007 13:08:16
01 Mar 2007 13:08:16 sjerre t replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
All you need to do is filter your recordset on the detail page with the same ID you pass in the URL.

<b>Jeremy Conn</b>
www.conncreativemedia.com
DW8 | ASP/VB/ASP.NET | Access/SQL
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>


Hi Jeremy

Is it possible to give an example for this? Currently I use this (and it works):
asp: cmdTemp.CommandText = "Select * From qryAsia where RegionId=1"
flash: loadVariables ("getdetails.asp?Record=0", this);

Now I want to send the RegionId from flash, so I do this:
flash: loadVariables ("getdetails.asp?RegionId=1", this);

But what do I do in the asp file? I tried
cmdTemp.CommandText = "Select * From qryAsia where RegionId=" & RegionId
But it doesn't work

Sorry for being a dymmy and thanks in advance
<img src=../images/fwzone/forum/icon_smile.gif border=0 align=middle>
Replied 01 Mar 2007 20:44:01
01 Mar 2007 20:44:01 Jeremy Conn replied:
Here is a section from a tutorial I wrote on dynamic details pages... this page shows you how to filter your detail page by the ID URL parameter being passed.

www.dmxzone.com/showDetail.asp?TypeId=2&NewsId=4404&LinkFile=page_four.htm

<b>Jeremy Conn</b>
www.conncreativemedia.com
DW8 | ASP/VB/ASP.NET | Access/SQL
Replied 03 Mar 2007 21:23:07
03 Mar 2007 21:23:07 sjerre t replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Hello,

I am trying to populate a photo gallery web page with dynamic data. The input is coming from a jump menu on the previous page that is populated dynamically. When a user chooses a photographer from the jump menu I want the gallery_detail page to display thumbnails and image details for that photographer. I can get the URL to include a request string, ie. gallery_detail.asp?photographerID=102, but how can I use this to populate the page with the correct info from the database. Thanks for any help.

Regards

Paul

<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Replied 03 Mar 2007 21:32:22
03 Mar 2007 21:32:22 sjerre t replied:
Thanks for the reply Jeremy
Unfortunately I'm not using dreamweaver. From Flash I refer to an ASP file which I edit in Notepad. What I'd need to know is how you can pass over a parameter from flash to the asp file and use this parameter to trigger a query.

<img src=../images/fwzone/forum/icon_smile_blackeye.gif border=0 align=middle>
Replied 03 Mar 2007 22:52:11
03 Mar 2007 22:52:11 sjerre t replied:
This is my asp file. I have the impession that my qyery "Select * From qryAsia where RegionId=" & CLng(Request("Region") doesn't work becaue I don't receive Region from flash



&lt;%
Set DataConn = Server.CreateObject("ADODB.Connection"
DataConn.Open "Driver=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("datafolder/partners.mdb"

Set cmdTemp = Server.CreateObject("ADODB.Command"
Set rstContacts = Server.CreateObject("ADODB.Recordset"

cmdTemp.CommandText = "Select * From qryAsia where RegionId=" & CLng(Request("Region")
'cmdTemp.CommandText = "Select * From qryAsia where RegionId=1"
cmdTemp.CommandType = 1

Set cmdTemp.ActiveConnection = DataConn

rstContacts.Open cmdTemp, , 1, 3

rstContacts.Move CLng(Request("Record")

Response.write "Name=" & Server.URLEncode(rstContacts("CompanyName") & "&"
Response.write "Country=" & Server.URLEncode(rstContacts("CompanyCountry") & "&"
Response.write "Description=" & Server.URLEncode(rstContacts("CompanyDescription") & "&"
Response.write "Region=" & Server.URLEncode(rstContacts("RegionName") & "&"
Response.write "Logo=" & Server.URLEncode(rstContacts("CompanyLogo") & "&"
Response.write "TotalRecords=" & rstContacts.RecordCount

rstContacts.Close
DataConn.Close

%&gt;

Reply to this topic