asp最常用的分页函数(4)
function showpage(totalnumber,maxperpage,filename)
%>
<tr>
<td height="20" colspan="9" bgcolor="#D6DFF7">
<%
dim n
if totalnumber mod maxperpage=0 then
n=totalnumber\maxperpage
else
n=totalnumber\maxperpage+1
end if
%>
<div align="center">共有<%=totalnumber%>/<%=maxperpage%>条,
当前页<%=currentpage%>/<%=n%>
<%if currentpage<2 then%>
[首页] [上一页]
<%else%>
<a href="<%=filename%>"><font color="red">[首页]</font></a> <a href="<%=filename%>&page=<%=currentpage-1%>"><font color="red">[上一页]</font></a>
<%end if%><% if n-currentpage<1 then%>
[下一页] [尾页]<%else%><a href="<%=filename%>&page=<%=currentpage+1%>"><font color="red">[下一页]</font></a> <a href="<%=filename%>&page=<%=n%>"><font color="red">[尾页]</font></a>
<%end if%>
转到:<select name="dd" class="sle"
onChange="location.href=this.options[this.selectedIndex].value">
<%for j=1 to n
if currentpage=j then
%><option value="<%=filename%>&page=<%=j%>" selected><%=j%></option>
<%
else
%>
<option value="<%=filename%>&page=<%=j%>"><%=j%></option>
<%
end if
next
%>
</select>
</div> </td>
</tr>
<%
end function
%>
<%
function showpage1(totalnumber,maxperpage,filename)
%>
<tr>
<td height="20" colspan="9" bgcolor="#D6DFF7">
内容版权声明:除非注明,否则皆为本站原创文章。