Forums
This topic is locked
Paging Without a Recordset
Posted 02 Aug 2004 15:28:01
1
has voted
02 Aug 2004 15:28:01 Matt Jukes posted:
Hi all,I have a page holding thumbnails.
Each THB has a variable attached (MyPage.asp?page=01)
This variable is passed to another page displaying the larger image connected to the THB named the same in another location, using a simple request.querystring("page" command.
This works perfectly ok, however i would like for users to be able to move through the image from the second page, and not have to go back to the main page and select the next.
I was wondering if there was a simple way in JS or ASP that i could code two buttons saying something like page +1 for the next or page -1 for previous.
Any Ideas would be appreciated. Thanks in Advance.
Matt
Replies
Replied 07 Aug 2004 13:25:35
07 Aug 2004 13:25:35 Scott Swabey replied:
If the number of thumbnails is static you could hardcode a variable into the large image display page to hold the number of images. If the number of thumbnails is dynamic then you will need to pass through the number of images as a variable. I will assume the later is true, so:
thumbnails page:
<font color=blue>'// build links from the thumbnails to the full size image
'// include the number of images in the querystring</font id=blue>
<pre id=code><font face=courier size=2 id=code>href='mypage.asp?page=01&count=23</font id=code></pre id=code>
full image page:
<font color=blue>'// display the image that matches the number passed through the querystring</font id=blue>
<pre id=code><font face=courier size=2 id=code>img src='images/<%=request("page"%>.gif'</font id=code></pre id=code>
<font color=blue>'// build Previous and Next buttons using the page and count values passed through the querystring</font id=blue>
<pre id=code><font face=courier size=2 id=code>count = request("count"
prev = page - 1
next = page + 1</font id=code></pre id=code>
<font color=blue>'// only display the previous or next button if there is a previous or next page</font id=blue>
<pre id=code><font face=courier size=2 id=code>IF prev > 0 THEN
response.write "href='mypage.asp?page="
response.write prev
response.write "&count="
response.write count
response.write "'>Previous</a> "
END IF</font id=code></pre id=code>
[code]IF next < count THEN
response.write "href='mypage.asp?page="
response.write next
response.write "&count="
response.write count
response.write "'>Next</a>"
END IF
Lafinboy Productions
www.lafinboy.com
website development :: website design :: graphic design
thumbnails page:
<font color=blue>'// build links from the thumbnails to the full size image
'// include the number of images in the querystring</font id=blue>
<pre id=code><font face=courier size=2 id=code>href='mypage.asp?page=01&count=23</font id=code></pre id=code>
full image page:
<font color=blue>'// display the image that matches the number passed through the querystring</font id=blue>
<pre id=code><font face=courier size=2 id=code>img src='images/<%=request("page"%>.gif'</font id=code></pre id=code>
<font color=blue>'// build Previous and Next buttons using the page and count values passed through the querystring</font id=blue>
<pre id=code><font face=courier size=2 id=code>count = request("count"
prev = page - 1
next = page + 1</font id=code></pre id=code>
<font color=blue>'// only display the previous or next button if there is a previous or next page</font id=blue>
<pre id=code><font face=courier size=2 id=code>IF prev > 0 THEN
response.write "href='mypage.asp?page="
response.write prev
response.write "&count="
response.write count
response.write "'>Previous</a> "
END IF</font id=code></pre id=code>
[code]IF next < count THEN
response.write "href='mypage.asp?page="
response.write next
response.write "&count="
response.write count
response.write "'>Next</a>"
END IF
Lafinboy Productions
www.lafinboy.com
website development :: website design :: graphic design