Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 17th, 2005, 06:20 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default Page 1-2-3-4 etc.... Next and Previous buttons

I have this code below in a page called 'bookdates_opt.asp'.

<%
set rscount=con.execute("select count(*) from trip_master where agencyid = '"&agencyid&"' and regular_trip = 'Option'")
count_rows = rscount("count(*)") ' number of rows in the db that is option
count_rows_div = count_rows/50
pages = round(count_rows_div)
Dim intRecordsPerPage
intRecordsPerPage = 50 ' how many records (bookings) are shown on each page

Dim queryPageOn
queryPageOn = count_rows

    If NOT isNumeric(queryPageOn) then
        queryPageOn = "1"
    End If
        queryPageOn = CINT(queryPageOn)
    Response.Write(sProjectPrev & "&nbsp;&nbsp;")

'''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''
'# Create Page Numbers & Links
' Creates 'Page' and '1', '2', '3' and so on,.....
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''

    response.Write "<table border=0 align=center bordercolor=#000000 width=200>"
    response.Write "<tr><td align=center>"
    Dim iPages, iPagesTemp

    response.write "Page&nbsp;&nbsp;"
    For iPages=1 to pages
    iPagesTemp = iPages-1

    If NOT queryPageOn=iPages then
    Response.write "<a href='?vara=" & iPagesTemp*intRecordsPerPage & "&timeoption="&timeoption&"&searchby="&user&"&agen cyid="&agencyid&"' ><b>" & iPages & "<b></a>&nbsp;&nbsp;&nbsp;"
    Else
    Response.write "<span class='greyt'>[</span><a href='?vara=" & iPagesTemp*intRecordsPerPage & "&page="& iPages & "'>" & iPages & "</a><span class='greyt'>]</span>"
    End If
    Next
    Response.Write(""&sProjectNext)
    response.write "</td></tr>"

    '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''
    ' Creates 'Previous' and 'Next' buttons to skip forwards and back from page to page '
    '''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''

    sStartQuery = vara
    response.write "<tr><td align=center>"

    If sStartQuery = "" or sStartQuery = "0" then 'The 'PREVIOUS' link is DISABLED
    sProjectPrev = "<a span class='sgrey'>Previous</span>"
    response.write "<a span class='sgrey'>Previous</span>"
    ElseIf sStartQuery > 0 then ' The 'PREVIOUS' link is ENABLED
    sProjectPrev = "<a class='elinks' href='?start=" & sStartQuery - intRecordsPerPage & "'>Previous</span>"
    response.write "<a class='elinks' href=# onclick='javascript: history.back()' title='Previous 50 Bookings'>Previous</span></a>"
    End If


    eEndQuery = sStartQuery+intRecordsPerPage
    response.write "&nbsp;&nbsp;"
    sMaxStart = (intPages*intRecordsPerPage)-intRecordsPerPage
    If eEndQuery > count_rows then ' The 'NEXT' link is DISABLED
    sProjectNext = "<a span class='sgrey'>Next</span>"
    response.write "<a span class='sgrey'>Next</span>"
    ElseIf eEndQuery < count_rows then ' The 'NEXT' link is ENABLED
    sProjectNext= "<a class='elinks' href='?vara=" & iPagesTemp*intRecordsPerPage & "'>Next</span>"
    response.write "<a class='elinks' href='?vara=" & sStartQuery + intRecordsPerPage & "&timeoption="&timeoption&"&agencyid="&agencyid&"& searchby="&user&"' title='Next 50 Bookings'>Next</span>"
    End If
    response.write "</td></tr>"
    response.write "</table>"

%>

It gives me a Page 1-2-3-4 etc.... at the foot of the page and it also give me a 'Next' and 'Previous' button, which all work fine.

What i am looking for is that when it says 'Page 1-2-3-4' etc.... then it UNDERLINES or HIGHLIGHTS the page that you are on.

For example, if you click '2' or click 'Next' to go to page two then '2' is underlined or has a [2] around it.

Similar to Google:

http://www.google.co.uk/search?q=st.+patrick's+day

Any ideas guys?

Thanks in advance.

Picco

www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt
__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk
 
Old March 18th, 2005, 12:00 PM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

http://www.experts-exchange.com/Web/..._21354240.html

for those of you that are interested

www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt





Similar Threads
Thread Thread Starter Forum Replies Last Post
Find previous page gandaliter PHP How-To 2 June 7th, 2007 11:55 AM
Previous Page equal's Nothing jamara ASP.NET 2.0 Professional 9 February 14th, 2007 03:46 PM
Next and Previous buttons. g_vamsi_krish ASP.NET 1.x and 2.0 Application Design 1 January 19th, 2006 11:19 AM
Checking Previous Page shs BOOK: Beginning ASP.NET 1.0 2 September 23rd, 2004 11:01 PM
next and previous page results mikeuk PHP Databases 1 July 19th, 2004 05:15 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.