Forums
This topic is locked
Image Gallery Database Navigation Question
09 Jan 2002 18:45:24 Pat Lee posted:
I'm creating an online image gallery with SQL Server 2000 and ASP using UltraDev...My setup:
Index.asp - One stored procedure which generates a filtered and sorted recordset of available images in the gallery, presented as a clickable thumbnail.
Detail.asp - One stored procedure that displays the actual inline image file as well as specific information related to that particular picture. ('ImageID' is the only variable passed to Detail.asp by Index.asp). This stored procedure returns one row.
When a user clicks on a thumbnail on Index.asp, the single full-size image is displayed in Detail.asp. But -- the user has to keep going back to Index.asp to view and access the other pictures from that particular gallery. How can I set up navigation in Detail.asp to give users "previous image" and "next image" navigation? I'm guessing I'll have to find some way to incorporate the stored procedure I use in index.asp to generate the filtered and sorted recordset of images. But since I'm only passing the "ImageID" variable to detail.asp, how can I keep track of where that particular image is located within the order of the recordset?
Any help would be greatly appreciated! Thanks
Replies
Replied 10 Jan 2002 09:30:03
10 Jan 2002 09:30:03 Viktor Farcic replied:
Just put in detail.asp same procedure as in index.asp and create something like:
<%
' Loop through all records
While NOT NameOfTheRecordset.EOF
'Checks if passed variable is the same as ID from recordset
If (NameOfTheRecordset.Fields.Item("ID".Value) = Request("ImageID" Then
*** Replace this with image ***
End If
NameOfTheRecordset.MoveNext()
Wend
%>
This way can keep track of where that particular image is located inside recordset. For creating navigation you must play with .MoveNext() .MovePrevious() .MoveFirst() .MoveLast().
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
I'm creating an online image gallery with SQL Server 2000 and ASP using UltraDev...
My setup:
Index.asp - One stored procedure which generates a filtered and sorted recordset of available images in the gallery, presented as a clickable thumbnail.
Detail.asp - One stored procedure that displays the actual inline image file as well as specific information related to that particular picture. ('ImageID' is the only variable passed to Detail.asp by Index.asp). This stored procedure returns one row.
When a user clicks on a thumbnail on Index.asp, the single full-size image is displayed in Detail.asp. But -- the user has to keep going back to Index.asp to view and access the other pictures from that particular gallery. How can I set up navigation in Detail.asp to give users "previous image" and "next image" navigation? I'm guessing I'll have to find some way to incorporate the stored procedure I use in index.asp to generate the filtered and sorted recordset of images. But since I'm only passing the "ImageID" variable to detail.asp, how can I keep track of where that particular image is located within the order of the recordset?
Any help would be greatly appreciated! Thanks
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Viktor Farcic
TalkZone Manager
<%
' Loop through all records
While NOT NameOfTheRecordset.EOF
'Checks if passed variable is the same as ID from recordset
If (NameOfTheRecordset.Fields.Item("ID".Value) = Request("ImageID" Then
*** Replace this with image ***
End If
NameOfTheRecordset.MoveNext()
Wend
%>
This way can keep track of where that particular image is located inside recordset. For creating navigation you must play with .MoveNext() .MovePrevious() .MoveFirst() .MoveLast().
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
I'm creating an online image gallery with SQL Server 2000 and ASP using UltraDev...
My setup:
Index.asp - One stored procedure which generates a filtered and sorted recordset of available images in the gallery, presented as a clickable thumbnail.
Detail.asp - One stored procedure that displays the actual inline image file as well as specific information related to that particular picture. ('ImageID' is the only variable passed to Detail.asp by Index.asp). This stored procedure returns one row.
When a user clicks on a thumbnail on Index.asp, the single full-size image is displayed in Detail.asp. But -- the user has to keep going back to Index.asp to view and access the other pictures from that particular gallery. How can I set up navigation in Detail.asp to give users "previous image" and "next image" navigation? I'm guessing I'll have to find some way to incorporate the stored procedure I use in index.asp to generate the filtered and sorted recordset of images. But since I'm only passing the "ImageID" variable to detail.asp, how can I keep track of where that particular image is located within the order of the recordset?
Any help would be greatly appreciated! Thanks
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Viktor Farcic
TalkZone Manager