Your already passing the img ID through your main page, why make this more difficult? Try this;
<%
imgID = Request("ImgID")
%>
<tr class="rslink">
<td align="center"><a href="<%= "/largeimage.asp?"imgID - 1%> ">PREVIOUS</a>
</tr>
But why the database need? Are you storing the imges in the dB?
Main Topics
Browse All Topics





by: ryancysPosted on 2008-03-06 at 23:54:27ID: 21068136
I'm not too sure how you "sort" the images' order, however, you may try something like this to get the previous image and next image's id by using this query:
SELECT yourTable.*,
(Select top 1 id from yourTable as temp1 where id < yourTable.id order by id desc) as previousID,
(Select top 1 id from yourTable as temp2 where id > yourTable.id order by id) as nextID
FROM yourTable
Where id = <currentID>
get the idea?