一个关于分页的问题(在线等)
我想在ASP页面的分页中显示的页码以 < <1 2 3 4 5> > 的形式来显示,主要的是让当前页以粗体的方式显示出来,并且不加超链接,为了直观的突出这一功能,写了一小段分页的代码,请达人们指点一下用ASP具体的实现那种效果方法
<%
exec= "select * from newsadd order by id desc "
set rs=server.createobject( "adodb.recordset ")
rs.open exec,cn,1,1
%>
<%
rs.PageSize=3
pagecount=rs.PageCount
page=int(request( "page "))
if page <=0 then page=1
if request( "page ")= " "then page=1
if page> rs.pagecount then page=rs.pagecount
rs.AbsolutePage=page
%>
<table width= "400 " border= "1 " align= "center " class= "biao " >
<tr>
<td> <span class= "STYLE2 "> 标题 </span> </div> </td>
<td> 加入时间 </td>
<td> 作者 </td>
<td> 编辑( <a href= "addnew.asp "> 添加 </a> ) </td>
</tr>
<%
if rs.eof and rs.bof then
response.write( "暂时还没有文章 ")
else
for i=1 to rs.PageSize
if rs.bof or rs.eof then exit for
%>
<tr>
<td> <%=rs( "title ") %> </td>
<td> <%= rs( "times ") %> </td>
<td> <%= rs( "author ") %> </td>
<td> 修改 删除 </td>
</tr>
<%
rs.MoveNext
next
end if
%>
</table>
<p align= "center ">
<%
for i=1 to pagecount
if
%>
<a href= "index.asp?page= <%=i%> "> <%=i%> </a>
<%
next
rs.close
set rs=nothing
%>
</body>
</html>
------解决方案--------------------改为这样就行了
<%
for i=1 to pagecount
if i=page then
response.write " <b> "&i& " </b> "
end if
%>
<a href= "index.asp?page= <%=i%> "> <%=i%> </a>
<%
next
rs.close
set rs=nothing
%>