Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Onclick movenext
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Onclick movenext

 Post Reply Post Reply
Author
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Topic: Onclick movenext
    Posted: 10 May 2003 at 9:00pm

I have two images (basically next and last). when the person clicks on them i wish to have the recordset goto the last or next record. do i have to create a variable that stores the next record in it and then do something like this http://myhost/myfile.asp?id=next or is there something easier?

Back to Top
farrukh View Drop Down
Groupie
Groupie
Avatar

Joined: 10 May 2002
Location: Pakistan
Status: Offline
Points: 147
Post Options Post Options   Thanks (0) Thanks(0)   Quote farrukh Quote  Post ReplyReply Direct Link To This Post Posted: 11 May 2003 at 3:08am
simple generate the id numbers of ur records so if user click on the previous its shows http://myhost/myfile.asp?id=1 and for the next it shows http://myhost/myfile.asp?id=3 because it currently shows the record whose id is 2.
i have collected some nice avatars (37) and smileys (227) here you can download
http://www24.brinkster.com/webmastertool/download.html
Back to Top
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post Posted: 12 May 2003 at 12:46pm

you cant just do it like that... think about if he deletes "id 3" he'll just get an error

i dont know how to do this, but am sure sumone else can tell you

Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 12 May 2003 at 2:40pm
or if i'm at the BOF or EOF
Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 12 May 2003 at 5:07pm

i tried using the following...

<a href="<%rs.movenext%>">Click Here</a>

it gives me an error. i thought that would work...

Back to Top
farrukh View Drop Down
Groupie
Groupie
Avatar

Joined: 10 May 2002
Location: Pakistan
Status: Offline
Points: 147
Post Options Post Options   Thanks (0) Thanks(0)   Quote farrukh Quote  Post ReplyReply Direct Link To This Post Posted: 13 May 2003 at 2:14am

suppose if you have a 2 fields. one of them is Football's Celebrities Names and second one is their its.
four records
table tblfootball
1   Beckham
2   Ronaldo
3   Zidane
4   Batistuta

If you give <a href="<%rs.movenext%>">Click Here</a>
then it shows <a href="beckham"> Click Here </a>

simply make a
sql = "select * from tblfootball"

if rs.BOF = true then
 do nothing
else
 rs.MovePrevious
 strPrevious = "< a href=""" & rs.fields(1) & """> Previous </a>"
end if

rs.movenext
response.write rs.fields(0)
****Result Would Be *****
Beckham
*** End Result ***

if rs.EOF = true then
 do nothing
else
 rs.movenext
 strNext = "<a href=""" & rs.fields(1) & """> Next </a>"
End if

response.write strPrevious & " &nbsp; &nbsp; " & strNext
************* Expected Result **************
shows not next button like this
<a href="yourpage.asp?FID=2"> Next </a>
and the Id 2 is belong to Ronaldo
***************************************
remind u the next record is fetched from database by id
do alter in ur query
if request.querystring("FID") = "" then
sql = "select * from tblfootball"
else
sql = "select * from tblfootball where id =" & request.querystring("FID") ""
end if

i have collected some nice avatars (37) and smileys (227) here you can download
http://www24.brinkster.com/webmastertool/download.html
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.