我想在ASP程序中做个CSDN分页的这种效果,当前页加粗或当前页下面有一个下划线

wjy217213 2009-03-20 03:09:26
我想在ASP程序中做个CSDN分页的这种效果,当前页加粗或当前页下面有一个下划线,效果如下图所示,最好有好的代码,我的代码太简单,根本就没这个效果,怎么改进呀?
<% rs.PageSize=10
pagenum=rs.PageCount
page=int(request("page"))
if page<=0 then page=1
rs.AbsolutePage=page
if rs.eof and rs.bof then
Response.Write "现在数据库中还没有新闻!"
else
for i=1 to rs.PageSize
rs.movenext
next
End If
for i=1 to pagenum%>
<a href="index.asp?page=<%=i%>"><%=i%></a>
<% next %>
...全文
64 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
Atai-Lu 2009-03-20
  • 打赏
  • 举报
回复
你这么写,如果有一千页或者一万页你岂不是也要全部输出了?
serch513 2009-03-20
  • 打赏
  • 举报
回复

for i=1 to pagenum
if page=i then
response.write("<a href=""index.asp?page="&i&"""> <u>"&i&"</u> </a> "
else
response.write("<a href=""index.asp?page="&i&"""> "&i&" </a> "
end if
next
wjy217213 2009-03-20
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 xiaofeng666 的回复:]
以前写过的代码,参考一下。
<table width="100%" border="1" align="center" cellpadding="3" cellspacing="1" bordercolor="#000099" style="border-collapse: collapse">
<%
pagenum=cint(request("pagenum"))
if pagenum <1 then
pagenum=1
end if
sql="select * from word_note where userid='"&session("name")&"' order by datetime desc"

rs.open "select * from department where typename…
[/Quote]

大哥,我不要 首页|上一页|下一页|尾页 这种,客户不喜欢
ligy19840101 2009-03-20
  • 打赏
  • 举报
回复
下划线是
<u><%=i%></u>
xiaofeng666 2009-03-20
  • 打赏
  • 举报
回复
以前写过的代码,参考一下。
<table width="100%" border="1" align="center" cellpadding="3" cellspacing="1" bordercolor="#000099" style="border-collapse: collapse">
<%
pagenum=cint(request("pagenum"))
if pagenum <1 then
pagenum=1
end if
sql="select * from word_note where userid='"&session("name")&"' order by datetime desc"

rs.open "select * from department where typename='"&session("bumen")&"'",conn,1,1
if rs("flag")=0 then
sql="select * from word_note where bumen='"&session("bumen")&"' order by datetime desc"
end if
rs.close

my=1
rs.open sql,conn,1,1
if not rs.eof then
number=rs.recordcount
rs.pagesize=30
my=rs.pagecount
If Pagenum >my Then
Pagenum = my
end if
rs.AbsolutePage=pagenum
%>
<tr align="center">
<td width="50%" height="22" bgcolor="#91CAFD">
<div align="center">工作日志标题</div></td>
<td width="10%" height="22" bgcolor="#91CAFD">姓名</td>
<td width="20%" height="22" bgcolor="#91CAFD">发布时间</td>
<td width="15%" height="22" bgcolor="#91CAFD">领导批示</td>
<td width="5%" bgcolor="#91CAFD">修改</td>
</tr>
<% for i=1 to rs.pagesize%>
<tr <%if i mod 2=0 then%>bgColor='#ECF5FF'<%end if%> onMouseOver="this.bgColor = '#94E6F3'" onMouseOut="<%if i mod 2=0 then%>this.bgColor='#ECF5FF'<%else%>this.bgColor='#ffffFF'<%end if%>">
<td style="TABLE-LAYOUT: fixed; WORD-BREAK: break-all;"> <a href="note_kan.asp?pubName=<%=rs("userid")%>&id=<%=rs("id")%>" onClick="window.open(this.href,'','width=655 height=480 top=150 left=150 scrollbars=yes');return false;">
<%=rs("title")%> </a> </td>
<td style="TABLE-LAYOUT: fixed; WORD-BREAK: break-all;"><div align="center"><%=rs("userid")%></div></td>
<td > <div align="center"><%=rs("datetime")%></div></td>
<td width="2%"> <div align="center">
<%if rs("show")=1 then
response.write "<font color='#ff0000'>已查看</font>|"
if len(trim(rs("huifu")))>0 then
response.write "<font color='#ff0000'>已批示</font>"
else
response.write "<font color='#666666'>未批示</font>"
end if
else
response.write "<font color='#666666'>未查看</font>|<font color='#666666'>未批示</font>"
end if%>
</div></td>
<td width="8%"><div align="center">
<%if rs("userid")=session("name") then%>
<a href="note_edit.asp?id=<%=rs("id")%>" class="b" onClick="javascript:window.open(this.href,'','width=655 height=480 top=100 left=150');return false;">
<img src="images/detail_off.gif" width="14" height="16" border="0">
</a>
<%else%>---<%end if%> </div></td>
</tr>
<%
rs.movenext
if rs.eof then
exit for
end if
next%>
<form action=<%=request.ServerVariables("URL")%>?search=<%=search%>&sf=<%=sf%>&lei_shu=<%=lei_shu%>®level=<%=reglevel%> method="post" name=form9>
<tr>
<td width="20%" height="18" colspan="5" align="center"> [共<%=my%>页<%=number%>条日志记录] <a href="<%=request.ServerVariables("URL")%>?search=<%=search%>&pagenum=1&sf=<%=sf%>&lei_shu=<%=lei_shu%>®level=<%=reglevel%>">
[首 页]</a> <%if pagenum>1 then%> <a href="<%=request.ServerVariables("URL")%>?search=<%=search%>&pagenum=<%=(pagenum-1)%>&sf=<%=sf%>&lei_shu=<%=lei_shu%>®level=<%=reglevel%>">[上一页]</a>
<%end if
if pagenum<my then%> <a href="<%=request.ServerVariables("URL")%>?search=<%=search%>&pagenum=<%=(pagenum+1)%>&sf=<%=sf%>&lei_shu=<%=lei_shu%>®level=<%=reglevel%>">
[下一页]</a> <%end if%> <a href="<%=request.ServerVariables("URL")%>?search=<%=search%>&pagenum=<%=my%>&sf=<%=sf%>&lei_shu=<%=lei_shu%>®level=<%=reglevel%>">[尾
页]</a> <input align="center" maxLength="3" name="pagenum" size="2" class="line" value="<%=pagenum%>" style="height:18">
<input name="button" type="button" style="FONT-SIZE: 9pt;height:18" onClick="check()" value="Goto" size="2">
</td>
</tr>
</form>
<%else%>
<tr>
<td height="25" colspan="5" align="center"> <span class="yb3"><font color="#FF0000">---该员工还没有工作日志记录---</font></span></td>
</tr>
<%
rs.close
end if

set rs=nothing%>
</table>
ligy19840101 2009-03-20
  • 打赏
  • 举报
回复
你可以判断,如果是当前页面的话就加上

<strong><%=i%></strong>

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧