Skip to main content
April 2, 2008
Question

display image from image path (ASP)

  • April 2, 2008
  • 1 reply
  • 338 views
Help needed please. Sorry if the topic has already been discussed. I did a search but it returned nothing.

My problem.
I can display images on my website by choosing the datasource and the image path from by database. No issues here. What I want is to be able to open up a larger image by clicking on this image.

I created another page. On this page is an image placeholder. The source again is the datasource with the image path to a larger image. I used a behaviour to open this page however, it shows the same image (the 1st record in my recordset) whichever image you click on my origianl page.

Can someone please tell me how to do it? It would be appreciated.
This topic has been closed for replies.

1 reply

Inspiring
April 2, 2008
I'm assuming that you are using a repeat region to display the original
images.

You will need to pass the Primary Key to the new page, and filter the
recordset on the new page based on that Primary Key.

For example, this would be the link to the new page:

<a href="page2.asp?ID=<%=(rsImages.Fields.Item("ImageID").Value)%>"

Then on the new page filter the recordset SQL based on the ImageID,
something like this:

<%
Dim rsImage__MMColParam
rsImage__MMColParam = "1"
If (Request.QueryString("ID") <> "") Then
rsImage__MMColParam = Request.QueryString("ID")
End If
%>
<%
Dim rsImage
Dim rsImage_cmd
Dim rsImage_numRows

Set rsImage_cmd = Server.CreateObject ("ADODB.Command")
rsImage_cmd.ActiveConnection = MM_connImage_STRING
rsImage_cmd.CommandText = "SELECT * FROM tblImages WHERE ImageID = ?"
rsImage_cmd.Prepared = true
rsImage_cmd.Parameters.Append rsImage_cmd.CreateParameter("param1", 5,
1, -1, rsImage__MMColParam) ' adDouble

Set rsImage = rsImage_cmd.Execute
rsImage_numRows = 0
%>


--
Ken Ford
Adobe Community Expert - Dreamweaver
Fordwebs, LLC
http://www.fordwebs.com


"leeweatherill" <webforumsuser@macromedia.com> wrote in message
news:ft00gm$spm$1@forums.macromedia.com...
> Help needed please. Sorry if the topic has already been discussed. I did a
> search but it returned nothing.
>
> My problem.
> I can display images on my website by choosing the datasource and the
> image
> path from by database. No issues here. What I want is to be able to open
> up a
> larger image by clicking on this image.
>
> I created another page. On this page is an image placeholder. The source
> again
> is the datasource with the image path to a larger image. I used a
> behaviour to
> open this page however, it shows the same image (the 1st record in my
> recordset) whichever image you click on my origianl page.
>
> Can someone please tell me how to do it? It would be appreciated.
>