联系方式

站长:
联系人:赵先生
手机:18183869808

QQ 64816414
保健茶:

联系人:罗小姐

电话:15368244381

QQ 834856496

几款asp翻页程序
发布者:zaq 类型:杂器快贴 发布时间:2018-9-21 13:27:11 浏览:3869次 [回复]
<%sub page_list(url)%>
<table cellSpacing=0 cellPadding=0 border="0" style="BORDER-COLLAPSE:collapse">
<tr>
<%if rs.pagecount=1 then%>
<td valign="bottom"><%=pages1%><font color=#ff0000><%=page%></font><%=pages%>&nbsp;<%=pages2%><font color=#ff0000><%response.write rs.pagecount%></font><%=pages%><font color=#ff0000><%=rs.RecordCount%></font>条</td>
<%elseif rs.PageCount>=2 then%>
<%if page=1 then%>
<td valign="bottom"><a class="type" href="<%=url%><%=page+1%>"><%=pages_n%><%=pages%></a>&nbsp;&nbsp;</td>
<td valign="bottom"><a class="type" href="<%=url%><%=rs.pagecount%>"><%=pages_l%><%=pages%></a>&nbsp;&nbsp;</td>
<%elseif page<>1 and page<>rs.PageCount then%>
<td valign="bottom"><a class="type" href="<%=url%>1"><%=pages_f%><%=pages%></a>&nbsp;&nbsp;</td>
<td valign="bottom"><a class="type" href="<%=url%><%=page-1%>"><%=pages_p%><%=pages%></a>&nbsp;&nbsp;</td>
<td valign="bottom"><a class="type" href="<%=url%><%=page+1%>"><%=pages_n%><%=pages%></a>&nbsp;&nbsp;</td>
<td valign="bottom"><a class="type" href="<%=url%><%=rs.pagecount%>"><%=pages_l%><%=pages%></a>&nbsp;&nbsp;</td>
<%elseif page=rs.PageCount then%>
<td valign="bottom"><a class="type" href="<%=url%>1"><%=pages_f%><%=pages%></a>&nbsp;&nbsp;</td>
<td valign="bottom"><a class="type" href="<%=url%><%=page-1%>"><%=pages_p%><%=pages%></a>&nbsp;&nbsp;</td>
<%end if%>
<td valign="bottom"><%=pages1%><font color=#ff0000><%=page%></font><%=pages%>&nbsp;每页<font color=#ff0000><%=rs.pagesize%></font>条&nbsp;<%=pages2%><font color=#ff0000><%response.write rs.pagecount%></font><%=pages%><font color=#ff0000><%=rs.RecordCount%></font>条</td>
<td valign=bottom>&nbsp;&nbsp;
<%="转到第"%>
<select name="page" onchange="if(this.options[this.selectedIndex].value!=''){location='<%=url%>'+this.options[this.selectedIndex].value;}">
<%for i=1 to rs.PageCount%>
<option value="<%=i%>" <%if page=i then%>selected<%end if%>><%=i%></option>
<%next%>
</select>
<%="页"%>
</td>
<%end if%>
</tr>
</table>
<%end sub%>

<!--页码标注-->
<%sub page_list1(url)%>
<table cellSpacing=0 bordercolor="#ff0000" cellPadding=0 border="0" style="BORDER-COLLAPSE:collapse">
<tr>
<%if rs1.pagecount=1 then%>
<td valign="bottom"><%=pages1%><font color=#ff0000><%=page%></font><%=pages%>&nbsp;<%=pages2%><font color=#ff0000><%response.write rs1.pagecount%></font><%=pages%></td>
<%elseif rs1.PageCount>=2 then%>
<%if page=1 then%>
<td valign="bottom"><a class="type" href="<%=url%><%=page+1%>"><%=pages_n%><%=pages%></a>&nbsp;&nbsp;</td>
<td valign="bottom"><a class="type" href="<%=url%><%=rs1.pagecount%>"><%=pages_l%><%=pages%></a>&nbsp;&nbsp;</td>
<td valign="bottom"><%=pages1%><font color=#ff0000><%=page%></font><%=pages%>&nbsp;<%=pages2%><font color=#ff0000><%response.write rs1.pagecount%></font><%=pages%></td>
<%elseif page<>1 and page<>rs1.PageCount then%>
<td valign="bottom"><a class="type" href="<%=url%>1"><%=pages_f%><%=pages%></a>&nbsp;&nbsp;</td>
<td valign="bottom"><a class="type" href="<%=url%><%=page-1%>"><%=pages_p%><%=pages%></a>&nbsp;&nbsp;</td>
<td valign="bottom"><a class="type" href="<%=url%><%=page+1%>"><%=pages_n%><%=pages%></a>&nbsp;&nbsp;</td>
<td valign="bottom"><a class="type" href="<%=url%><%=rs1.pagecount%>"><%=pages_l%><%=pages%></a>&nbsp;&nbsp;</td>
<td valign="bottom"><%=pages1%><font color=#ff0000><%=page%></font><%=pages%>&nbsp;<%=pages2%><font color=#ff0000><%response.write rs1.pagecount%></font><%=pages%></a>&nbsp;&nbsp;</td>
<%elseif page=rs1.PageCount then%>
<td valign="bottom"><a class="type" href="<%=url%>1"><%=pages_f%><%=pages%></a>&nbsp;&nbsp;</td>
<td valign="bottom"><a class="type" href="<%=url%><%=page-1%>"><%=pages_p%><%=pages%></a>&nbsp;&nbsp;</td>
<td valign="bottom"><%=pages1%><font color=#ff0000><%=page%></font><%=pages%>&nbsp;<%=pages2%><font color=#ff0000><%response.write rs1.pagecount%></font><%=pages%></td>
<%end if%>
<td valign=bottom>&nbsp;&nbsp;
<%="转到第"%>
<select name="page" onchange="if(this.options[this.selectedIndex].value!=''){location='<%=url%>'+this.options[this.selectedIndex].value;}">
<%for i=1 to rs1.PageCount%>
<option value="<%=i%>" <%if page=i then%>selected<%end if%>><%=i%></option>
<%next%>
</select>
<%="页"%>
</td>
<%end if%>
</tr>
</table>
<%end sub%>
<%
function page_list123(url)
dim page_str
page=cint(page)
if rs.pagecount=1 then
page_str=pages1&"<font color=#ff0000>"&page&"</font>"&pages&"&nbsp;"&pages2&"<font color=#ff0000>"&rs.pagecount&"</font>"&pages&"<font color=#ff0000>"&rs.RecordCount&"</font>条"
elseif rs.PageCount>=2 then
if page=1 then
page_str="<a class=type href="&url&page+1&">"&pages_n&pages&"</a>&nbsp;&nbsp;"
page_str=page_str&"<a class=type href="&url&rs.pagecount&">"&pages_l&pages&"</a>&nbsp;&nbsp;"
elseif page<>1 and page<>rs.PageCount then
page_str="<a class=type href="&url&"1>"&pages_f&pages&"</a>&nbsp;&nbsp;"
page_str=page_str&"<a class=type href="&url&page-1&">"&pages_p&pages&"</a>&nbsp;&nbsp;"
page_str=page_str&"<a class=type href="&url&page+1&">"&pages_n&pages&"</a>&nbsp;&nbsp;"
page_str=page_str&"<a class=type href="&url&rs.pagecount&">"&pages_l&pages&"</a>&nbsp;&nbsp;"
elseif page=rs.PageCount then
page_str="<a class=type href="&url&"1>"&pages_f&pages&"</a>&nbsp;&nbsp;"
page_str=page_str&"<a class=type href="&url&page-1&">"&pages_p&pages&"</a>&nbsp;&nbsp;"
end if
page_str=page_str&pages1&"<font color=#ff0000>"&page&"</font>"&pages&"&nbsp;每页<font color=#ff0000>"&rs.pagesize&"</font>条&nbsp;"&pages2&"<font color=#ff0000>"&rs.pagecount&"</font>"&pages&"<font color=#ff0000>"&rs.RecordCount&"</font>条"
page_str=page_str&"&nbsp;&nbsp;转到第"
page_str=page_str&"<select name=page onchange=""if(this.options[this.selectedIndex].value!=''){location='"&url&"'+this.options[this.selectedIndex].value;}"">"
for i=1 to rs.PageCount
page_str=page_str&"<option value="&i
if page=i then page_str=page_str&" selected"
page_str=page_str&">"&i&"</option>"
next
page_str=page_str&"</select>页"
end if
page_list123=page_str
end function

'page
'page current page
'rows records
'page_size page size
'page_rows page_rows
function page_list1234(url,page,rows,page_size,page_rows)
dim page_str,k,k1,n,p,pagess
if(trim(page)="") then page=1
pagess=rows/page_size
if pagess-cint(pagess)>0 then pagess=cint(pagess)+1
if pagess=1 or rows<1 then exit function
if page>pagess then page=pagess
if page<=0 then page=1
k=page/page_rows
k1=int(k)*page_rows
if pagess<=page_rows then
n=pagess
k1=0
else
if page mod page_rows=0 then
k1=k1-page_rows
n=page_rows
else
if pagess-k1<page_rows then
n=pagess-k1
else
n=page_rows
end if
end if
end if
if pagess<=1 then
page_str="<a href="&url&"1>[<b>1</b>]</a>&nbsp;&nbsp;"
else
'if page>page_rows then page_str=page_str&"<a href="&url&k1&">[上"&page_rows&"页]&nbsp;&nbsp;</a>"
if page>page_rows then page_str=page_str&"<a href="&url&page-1&">[上一页]&nbsp;&nbsp;</a>"
for i=1 to n
p=k1+i
if p=page then
page_str=page_str&"[<b>"&p&"</b>]&nbsp;&nbsp;"
else
page_str=page_str&"<a href="&url&p&">"&p&"</a>&nbsp;&nbsp;"
end if
next
'if n=page_rows and pagess<>k1+page_rows then page_str=page_str&"<a href="&url&trim(k1+page_rows+1)&">[下"&page_rows&"页]</a>"
if n=page_rows and pagess<>k1+page_rows then page_str=page_str&"<a href="&url&page+1&">[下一页]</a>"
end if
page_list1234="共"&rows&"条&nbsp;&nbsp;"&page_str
end function
%〉
源地址:http://www.zaqi.net/word_view.asp?files_id=2207
上一篇:asp中关于取整函数的应用
下一篇:一个很不错的php翻页程序
零售:¥138元
零售:¥39元
零售:¥68元
批发:¥55元
零售:¥12元
批发:¥8元
零售:¥148元
杂器网络版权所有  免责声明