请问要实现asp文章伪静态化分页该如果写分页代码啊

fwy12 2009-11-14 01:18:52
<%
If id="" and page="" Then
serversc=Request.ServerVariables("QUERY_STRING")
id=replace(serversc,"/","")
id=replace(id,".html","")
arr=split(id,"-")
id=arr(0)
page=arr(1)
End If
%>


哪么我以前的分页连接是这样的。

<a href=?id="&id&"&Page="&i&">"&i&"</a
该如何修改呢??


 <%  '==================================================   
'过程名:listbody
'作 用:按要求显示文章内容
'参 数:body ------ 文章内容
'==================================================
Sub listbody(body)
dim arrbody,pages
if Instr(body,"[NextPage]")<=0 then
response.write body
'response.write "</p><p align='center'><font color='red'><b>[1]</b></font></p>"
else
CurPage=request("CurPage")
arrbody=split(body,"[NextPage]")
pages=Ubound(arrbody)+1
if CurPage="" then
CurPage=1
else
CurPage=Cint(CurPage)
end if
if CurPage<1 then CurPage=1
if CurPage>pages then CurPage=pages
response.write arrbody(CurPage-1)
response.write "<div align=center>"
for i=1 to pages
if i=Curpage then response.write "[<font color=red>"&i&"</font>] " else response.write "[<a href=?id="&id&"&CurPage="&i&">"&i&"</a>] "
next
response.write "</div>"
end if
End Sub
%>
<% call(listbody(rsnews("content")))%>


...全文
187 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
fwy12 2009-11-17
  • 打赏
  • 举报
回复
还是没明白呢
fwy12 2009-11-16
  • 打赏
  • 举报
回复
有没有这方面的例子呢
fwy12 2009-11-15
  • 打赏
  • 举报
回复
我只传递一个参数ID的时候是会的。可是一有分页代码的就弄不清楚了
  • 打赏
  • 举报
回复
你的正则呢??....主要是两者匹配一下就好了...

比如说2342_1.html就代表第一页
2342_2.html代表第二页

href="<%=id%>_<%=cur-1%>.html"
fwy12 2009-11-15
  • 打赏
  • 举报
回复
没人知道这个问题么,。我改了好多次都不对

28,406

社区成员

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

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