|
Makale Sayfalama
Makalemizi sayfalatacağımız paging.asp
<--------------- paging.asp başlangıç --------------->
<% @ Language="VBScript" %> <% Option Explicit %> <% `*************************************************` `*************************************************` `** `** Content Paging `** 17.01.2005 - Monday `** Coded by Deathrole `** deathrole(at)msn(dot)com `** ASP Rehberi - www.asprehberi.net `** `*************************************************` `*************************************************`
`Hata olursa bir sonraki satirdan devam et. On Error Resume Next Dim page Dim yazi
Function Paging(content,page) If InStr(content,"<!--page-->") <> 0 Then Dim arrPaged, pkey arrPaged = Split(content,"<!--page-->",-1,1) pkey = page-1 Paging = arrPaged(pkey) Else Paging = content End If End Function
Function PNumber(content,page) Dim p,i,s For i = 1 to Len(content) If Mid(content,i,11) = "<!--page-->" then p = p+1 End If Next For s = 1 to p+1 If not trim(s) = trim(page) then Response.Write "<a href=`" & Request.ServerVariables("Script_Name") & "?page="&s&"`>"& s &"</a> " Else Response.Write ""& s &" " End If Next End Function
page = trim(Request.QueryString("page")) If page="" then page = 1 yazi = "stringpage1<!--page-->stringpage2<!--page-->stringpage3<!--page-->stringpage4" Response.Write Paging(yazi,page) %>
<% Response.Write PNumber(yazi,page) %>
ASPREHBERI.NET sitesinden Alıntıdır.
|
 |