SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Evangelist ckchin's Avatar
    Join Date
    Mar 2002
    Location
    msia
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question How do write this kind of navigational links (paging)

    Please refer to altavista by search the 'asp'.

    First page:
    [<< Prev] 1 2 3 4 5 6 7 8 9 10 [Next >>]

    Second page:
    [<< Prev] 1 2 3 4 5 6 7 8 9 10 [Next >>]

    BUT, at the 10th page:
    [<< Prev] 5 6 7 8 9 10 11 12 13 14 [Next >>]

    How do make this kind of navigational links in asp?

    Yes! there is thread of this problem at http://www.sitepointforums.com/showt...threadid=52275 (BUT this relates to php navigational link, and not asp).

    Thanks in advance.

  2. #2
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've got a way to do it here: http://www.sitepointforums.com/showt...threadid=42104

    If you need help, let me know


  3. #3
    SitePoint Evangelist ckchin's Avatar
    Join Date
    Mar 2002
    Location
    msia
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thanks for you help

    Hi,

    I would like say thank you for your help, and will check the link reght away.

    Thanks,

    ckchin
    Malaysia

  4. #4
    SitePoint Evangelist
    Join Date
    Oct 2001
    Location
    Texas
    Posts
    598
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    to let you know i configure my search to do exactly what you are saying and if you would like to see it let me know and i would love to help you if you need it.

  5. #5
    SitePoint Evangelist
    Join Date
    Oct 2001
    Location
    Texas
    Posts
    598
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    response.write("<p align=""center""><span class=""arial"">")
    		If iPageCurrent > 1 Then
    			response.write("<a href=""" & strURL & "?searchfor=" & Server.URLEncode(Request.QueryString("searchfor")) & "&searchby=" & Server.URLEncode(Request.QueryString("searchby")) & "&contain=" & Server.URLEncode(Request.QueryString("contain")) & "&page=" & iPageCurrent - 1 &""">[&lt;&lt; Prev]</a> ")
    		End If
    
    		if iPageCurrent < 6 then
    			startcount = 1
    			endcount = 10
    		elseif iPageCurrent > 5 AND iPageCurrent < iPageCount - 3 then
    			startcount = iPageCurrent - 4
    			endcount = iPageCurrent + 4
    		elseif iPageCurrent > iPageCount - 4 then
    			startcount = iPageCount - 8
    			endcount = iPageCount
    		end if
    		if endcount > iPageCount then
    			endcount = iPageCount
    		end if
    				
    		For I = startcount To endcount
    			If I = iPageCurrent Then
    				response.write("<b>" & I & " </b>")
    			Else
    				response.write("<a href=""" & strURL &"?searchfor=" & Server.URLEncode(Request.QueryString("searchfor")) & "&searchby=" & Server.URLEncode(Request.QueryString("searchby")) & "&contain=" & Server.URLEncode(Request.QueryString("contain")) & "&page=" & I & """>" & I & "</a> ")
    			End If
    		Next 'I
    		If iPageCurrent < iPageCount Then
    			response.write("<a href=""" & strURL & "?searchfor=" & Server.URLEncode(Request.QueryString("searchfor")) & "&searchby=" & Server.URLEncode(Request.QueryString("searchby")) & "&contain=" & Server.URLEncode(Request.QueryString("contain")) & "&page=" & iPageCurrent + 1 &""">[Next &gt;&gt;]</a>")
    		End If
    		response.write("</p><br>")
    yeah this is with a database search but this is basically what i did


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •