这是一个用下拉菜单来做翻页的通用代码,我觉得这样做比较省空间,蛮好的
其实这个代码就是老外的那个翻页插件,后来是哪位好朋友(不好意思,忘了)修改后放在论坛上的,我还做成过插件,其实光是拷贝也挺方便的。
还有最后一段是前后翻页的按钮,呵呵,这个还是ccjat提醒后加上的,用不用都随便咯。
1
2记录集名字_total = 记录集名字.RecordCount
3
4If (记录集名字_numRows < 0) Then
5记录集名字_numRows = 记录集名字_total
6Elseif (记录集名字_numRows = 0) Then
7记录集名字_numRows = 1
8End If
9
10记录集名字_first = 1
11记录集名字_last = 记录集名字_first + 记录集名字_numRows - 1
12
13If (记录集名字_total <> -1) Then
14If (记录集名字_first > 记录集名字_total) Then 记录集名字_first = 记录集名字_total
15If (记录集名字_last > 记录集名字_total) Then 记录集名字_last = 记录集名字_total
16If (记录集名字_numRows > 记录集名字_total) Then 记录集名字_numRows = 记录集名字_total
17End If
1
2
3If (记录集名字_total = -1) Then
4
5记录集名字_total=0
6While (Not 记录集名字.EOF)
7记录集名字_total = 记录集名字_total + 1
8记录集名字.MoveNext
9Wend
10
11If (记录集名字.CursorType > 0) Then
12记录集名字.MoveFirst
13Else
14记录集名字.Requery
15End If
16
17If (记录集名字_numRows < 0 Or 记录集名字_numRows > 记录集名字_total) Then
18记录集名字_numRows = 记录集名字_total
19End If
20
21记录集名字_first = 1
22记录集名字_last = 记录集名字_first + 记录集名字_numRows - 1
23If (记录集名字_first > 记录集名字_total) Then 记录集名字_first = 记录集名字_total
24If (记录集名字_last > 记录集名字_total) Then 记录集名字_last = 记录集名字_total
25
26End If
1
2Set MM_rs = 记录集名字
3MM_rsCount = 记录集名字_total
4MM_size = 记录集名字_numRows
5MM_uniqueCol = ""
6MM_paramName = ""
7MM_offset = 0
8MM_atTotal = false
9MM_paramIsDefined = false
10If (MM_paramName <> "") Then
11MM_paramIsDefined = (Request.QueryString(MM_paramName) <> "")
12End 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