asp分頁函式
function exportpageinfo(byref rs,curpage,i,linkfile)
dim retval, j, pagenumber, basepage
retval = "第" & curpage & "頁/總" & rs.pagecount & "頁 "
retval = retval & "本頁" & i & "條/總" & rs.recordcount & "條 "
if curpage = 1 then
retval = retval & "首頁 前頁 "
else
retval = retval & "首頁
前頁 "
end if
if curpage = rs.pagecount then
retval = retval & "後頁 末頁"
else
retval = retval & "後頁
末頁"
end if
retval = retval & "
" basepage = (curpage \ 10) * 10
if basepage > 0 then retval = retval & " <<"
for j = 1 to 10
pagenumber = basepage + j
if pagenumber > rs.pagecount then exit for
if pagenumber = cint(curpage) then
retval = retval & " " & pagenumber & ""
else
retval = retval & " " & pagenumber & ""
end if
next
if rs.pagecount > basepage then retval = retval & " >>"
exportpageinfo = retval
end function
應用<%
adopagers.open "select * from news order by addtime desc", conn, 1, 1
if err.number <> 0 then
response.write "資料庫操作失敗:"&err.description
else
if adopagers.eof and adopagers.bof then
response.write "沒有記錄"
else
%>
新 聞 標 題
日期操 作
<%
adopagers.pagesize = 10
adopagers.absolutepage = curpage
for i = 0 to 9
%>
<%= adopagers("title") %>
<% = adopagers("addtime") %>
'>編輯
)'>刪除
<%
adopagers.movenext
if adopagers.eof then
i = i + 1
exit for
end if
next
%>
<% = exportpageinfo(adopagers, curpage, i, "newsman.asp?") %>
asp數字分頁函式
function showpage totalnumber,maxperpage,filename dim n if totalnumber mod maxperpage 0 then n totalnumber maxperpage else n totalnumber maxperpage 1 ...
asp分頁系統
asp分頁系統 引數處理,並把相應 插入code 分頁 和mdbsql 資料庫查詢 中 sub s keyword s value keyword s value 建議先對keyword進行處理 if keyword then code code keyword keyword text split...
ASP內容分頁
利用統計文章字數,然後達到一定字數就截斷輸出,但是分頁的內容就會在莫名其妙的地方截斷,不是很友好。很簡單,在要截斷的地方附近找下面的符號 如果後面存在或 就分頁。主要是要研究文章的格式。if request.servervariables content length 0 then content ...