這是一個用下拉菜單來做翻頁的通用代碼,我覺得這樣做比較省空間,蠻好的
其實這個代碼就是老外的那個翻頁插件,后來是哪位好朋友(不好意思,忘了)修改后放在論壇上的,我還做成過插件,其實光是拷貝也挺方便的。
還有最后一段是前后翻頁的按鈕,呵呵,這個還是ccjat提醒后加上的,用不用都隨便咯。
<%
記錄集名字_total = 記錄集名字.recordcount
if (記錄集名字_numrows < 0) then
記錄集名字_numrows = 記錄集名字_total
elseif (記錄集名字_numrows = 0) then
記錄集名字_numrows = 1
end if
記錄集名字_first = 1
記錄集名字_last = 記錄集名字_first 記錄集名字_numrows - 1
if (記錄集名字_total <> -1) then
if (記錄集名字_first > 記錄集名字_total) then 記錄集名字_first = 記錄集名字_total
if (記錄集名字_last > 記錄集名字_total) then 記錄集名字_last = 記錄集名字_total
if (記錄集名字_numrows > 記錄集名字_total) then 記錄集名字_numrows = 記錄集名字_total
end if
%>
<%
if (記錄集名字_total = -1) then
記錄集名字_total=0
while (not 記錄集名字.eof)
記錄集名字_total = 記錄集名字_total 1
記錄集名字.movenext
wend
if (記錄集名字.cursortype > 0) then
記錄集名字.movefirst
else
記錄集名字.requery
end if
if (記錄集名字_numrows < 0 or 記錄集名字_numrows > 記錄集名字_total) then
記錄集名字_numrows = 記錄集名字_total
end if
記錄集名字_first = 1
記錄集名字_last = 記錄集名字_first 記錄集名字_numrows - 1
if (記錄集名字_first > 記錄集名字_total) then 記錄集名字_first = 記錄集名字_total
if (記錄集名字_last > 記錄集名字_total) then 記錄集名字_last = 記錄集名字_total
end if
%>
<%
set mm_rs = 記錄集名字
mm_rscount = 記錄集名字_total
mm_size = 記錄集名字_numrows
mm_uniquecol = ""
mm_paramname = ""
mm_offset = 0
mm_attotal = false
mm_paramisdefined = false
if (mm_paramname <> "") then
mm_paramisdefined = (request.querystring(mm_paramname) <> "")
end if
%>
<%
if (not mm_paramisdefined and mm_rscount <> 0) then
r = request.querystring("index")
if r = "" then r = request.querystring("offset")
if r <> "" then mm_offset = int(r)
本新聞共3頁,當前在第1頁 1 2 3
新聞熱點
疑難解答