這是一個用下拉菜單來做翻頁的通用代碼,我覺得這樣做比較省空間,蠻好的
其實這個代碼就是老外的那個翻頁插件,后來是哪位好朋友(不好意思,忘了)修改后放在論壇上的,我還做成過插件,其實光是拷貝也挺方便的。
還有最后一段是前后翻頁的按鈕,呵呵,這個還是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
新聞熱點
疑難解答