end sub %> 调用 rs.pagesize=10 ShowOnePage rs,1 '显示一页 10条记录
你说的是ASP中的翻页么? 要是的话我有现成的了! dim pagesize pagesize=25 dim currentpage if Request("cpage")="" then currentpage=1 else currentpage=trim(Request("cpage")) end if currentpage=cint(currentpage) if not rs_line_infor.EOF then rs_line_infor.PageSize=pagesize rs_line_infor.AbsolutePage=currentpage
end if%> <%if currentpage=1 then %> <img src="images/an.gif" width="19" height="19" border="0"> <%else%> <a href="tour_manage.asp?cpage=<%=currentpage-1%>" ><img src="images/an.gif" width="19" height="19" border="0"></a> <%end if%> <%if currentpage=rs_line_infor.PageCount then%> <img src="images/an3.gif" width="19" height="19" border="0"> <%else%> <a href="tour_manage.asp?cpage=<%=currentpage+1%>" ><img src="images/an3.gif" width="19" height="19" border="0"></a> <%end if%> <% 'while not rs_line_infor.EOF dim count1 count1=0 while not rs_line_infor.EOF and count1<pagesize count1=count1+1 %> <% rs_line_infor.MoveNext wend set rs_line_infor=nothing set conn=nothing %>
這几個屬性可能有用
这是我写的一个asp的!和vb一样!
<%
sub ShowOnePage(rs,Page)rs.absolutepage=Page
for ipage=1 to rs.pagesize%>
<tr>
<% recno=(Page-1)*rs.pagesize+ipage %>
<td width="7%" bgcolor="#FFFFFF"><div align="center"><font color="#999999" size="2"><%=recno%></font></div></td>
<td width="18%" bgcolor="#FFFFFF"><div align="center"><font color="#0066CC" size="2"><%=rs.fields("admindataname")%></font></div></td>
<td width="7%" bgcolor="#FFFFFF"><div align="center"><font color="#0066CC" size="2"><%=rs.fields("admindatalx")%></font></div></td>
<td width="16%" bgcolor="#FFFFFF"><div align="center"><font color="#33CC00" size="2"><%=rs.fields("admindatatn")%></font></div></td>
<td width="6%" bgcolor="#FFFFFF"><a href=<%=rs.fields("admindataurl")%> target="_blank"><div align="center"><font color="#0066FF" size="2">url</font></div></a></td>
<td width="9%" bgcolor="#FFFFFF"><div align="center"><font color="#0066FF" size="2">详细</font></div></td>
<td width="9%" bgcolor="#FFFFFF"><div align="center"><font color="#999999" size="2"><%=rs.fields("admindataurlloadcs")%></font></div></td>
<td width="28%" bgcolor="#FFFFFF"><div align="center"><font color="#330000" size="2"><%=rs.fields("username")%>(<font color="#990000"><%=rs.fields("userdj")%></font>)</font></div></td>
<%
rs.movenext
if rs.eof then exit for
next
end sub
%>
调用
rs.pagesize=10
ShowOnePage rs,1
'显示一页 10条记录
要是的话我有现成的了!
dim pagesize
pagesize=25
dim currentpage
if Request("cpage")="" then
currentpage=1
else
currentpage=trim(Request("cpage"))
end if
currentpage=cint(currentpage)
if not rs_line_infor.EOF then
rs_line_infor.PageSize=pagesize
rs_line_infor.AbsolutePage=currentpage
end if%> <%if currentpage=1 then
%> <img src="images/an.gif" width="19" height="19" border="0"> <%else%> <a href="tour_manage.asp?cpage=<%=currentpage-1%>" ><img src="images/an.gif" width="19" height="19" border="0"></a>
<%end if%> <%if currentpage=rs_line_infor.PageCount then%> <img src="images/an3.gif" width="19" height="19" border="0">
<%else%> <a href="tour_manage.asp?cpage=<%=currentpage+1%>" ><img src="images/an3.gif" width="19" height="19" border="0"></a>
<%end if%>
<%
'while not rs_line_infor.EOF
dim count1
count1=0
while not rs_line_infor.EOF and count1<pagesize
count1=count1+1
%>
<%
rs_line_infor.MoveNext
wend
set rs_line_infor=nothing
set conn=nothing
%>