您好!关于一个ASP分页的问题
<%DimfileName,postion,iDimpre,last,intpage,pageNoSubPage1()fileName=Request.ServerVar...
<%
Dim fileName,postion,i
Dim pre,last,intpage,pageNo
Sub Page1()
fileName = Request.ServerVariables("script_name")
postion = InstrRev(fileName,"/")+1
fileName = Mid(fileName,postion)
pre = true
last = true
'page = trim(Request.QueryString("page"))
pageNo = Request("page")
if len(pageNo) = 0 then
intpage = 1
pre = false
else
if cint(pageNo) =< 1 then
intpage = 1
pre = false
else
if cint(pageNo) >= oRs.PageCount then
intpage = oRs.PageCount
last = false
else
intpage = cint(pageNo)
end if
end if
end if
if not oRs.eof then
oRs.AbsolutePage = intpage
end if
End sub
Sub Page()
%>
<table width="100%" height="24" align="center" cellpadding="0" cellspacing="0">
<tr>
<%if oRs.pagecount > 0 then%>
<td width="13%" align="left" bordercolor="#999999" border="1" style="border-top-style:dotted; border-top-width:1px; border-bottom-style:dotted; border-bottom-width:1px; padding-left:15px; padding-right:15px" bgcolor="#F0F0F0" height="24">当前页<%=intpage%>/<%=oRs.PageCount%></td>
<%else%>
<td width="41%" align="left" style="border-top-style:dotted; border-top-width:1px; border-bottom-style:dotted; border-bottom-width:1px; padding-left:15px; padding-right:15px" bgcolor="#F0F0F0" height="24">当前页0/0</td><%end if%>
<td width="46%" align="right" style="border-top-style:dotted; border-top-width:1px; border-bottom-style:dotted; border-bottom-width:1px; padding-left:15px; padding-right:15px" bgcolor="#F0F0F0" height="24"> <a href="<%=fileName%>?page=1">首页</a>|
<%if pre then%>
<a href="<%=fileName%>?page=<%=intpage -1%>">上页</a>| <%end if%>
<%if last then%>
<a href="<%=fileName%>?page=<%=intpage +1%>">下页</a> |<%end if%>
<a href="<%=fileName%>?page=<%=oRs.PageCount%>">尾页</a>|转到第
<select name="sel_page" onchange="javascript:location=this.options[this.selectedIndex].value;">
<%
for i = 1 to oRs.PageCount
if i = intpage then%>
<option value="<%=fileName%>?page=<%=i%>" selected><%=i%></option>
<%else%>
<option value="<%=fileName%>?page=<%=i%>"><%=i%></option>
<%
end if
next
%>
</select>页</font>
</td>
</tr>
</table>
<%
End Sub
%>
问题补充:可否看出这个为何不能分页?。。。可以限制条数,可是却不能正确地显示上一页,下一页。。。。
可以限制条数,可是却不能正确地显示上一页,下一页,这是为什么?
以上是您在2007年4月6日问过的问题...我也想问这个...这个CMS是ESCMS的..现在我只能看到1/1页....其实我有1/3页呢...后面的两页看不到了...请问这是怎么回事啊?谢了... 展开
Dim fileName,postion,i
Dim pre,last,intpage,pageNo
Sub Page1()
fileName = Request.ServerVariables("script_name")
postion = InstrRev(fileName,"/")+1
fileName = Mid(fileName,postion)
pre = true
last = true
'page = trim(Request.QueryString("page"))
pageNo = Request("page")
if len(pageNo) = 0 then
intpage = 1
pre = false
else
if cint(pageNo) =< 1 then
intpage = 1
pre = false
else
if cint(pageNo) >= oRs.PageCount then
intpage = oRs.PageCount
last = false
else
intpage = cint(pageNo)
end if
end if
end if
if not oRs.eof then
oRs.AbsolutePage = intpage
end if
End sub
Sub Page()
%>
<table width="100%" height="24" align="center" cellpadding="0" cellspacing="0">
<tr>
<%if oRs.pagecount > 0 then%>
<td width="13%" align="left" bordercolor="#999999" border="1" style="border-top-style:dotted; border-top-width:1px; border-bottom-style:dotted; border-bottom-width:1px; padding-left:15px; padding-right:15px" bgcolor="#F0F0F0" height="24">当前页<%=intpage%>/<%=oRs.PageCount%></td>
<%else%>
<td width="41%" align="left" style="border-top-style:dotted; border-top-width:1px; border-bottom-style:dotted; border-bottom-width:1px; padding-left:15px; padding-right:15px" bgcolor="#F0F0F0" height="24">当前页0/0</td><%end if%>
<td width="46%" align="right" style="border-top-style:dotted; border-top-width:1px; border-bottom-style:dotted; border-bottom-width:1px; padding-left:15px; padding-right:15px" bgcolor="#F0F0F0" height="24"> <a href="<%=fileName%>?page=1">首页</a>|
<%if pre then%>
<a href="<%=fileName%>?page=<%=intpage -1%>">上页</a>| <%end if%>
<%if last then%>
<a href="<%=fileName%>?page=<%=intpage +1%>">下页</a> |<%end if%>
<a href="<%=fileName%>?page=<%=oRs.PageCount%>">尾页</a>|转到第
<select name="sel_page" onchange="javascript:location=this.options[this.selectedIndex].value;">
<%
for i = 1 to oRs.PageCount
if i = intpage then%>
<option value="<%=fileName%>?page=<%=i%>" selected><%=i%></option>
<%else%>
<option value="<%=fileName%>?page=<%=i%>"><%=i%></option>
<%
end if
next
%>
</select>页</font>
</td>
</tr>
</table>
<%
End Sub
%>
问题补充:可否看出这个为何不能分页?。。。可以限制条数,可是却不能正确地显示上一页,下一页。。。。
可以限制条数,可是却不能正确地显示上一页,下一页,这是为什么?
以上是您在2007年4月6日问过的问题...我也想问这个...这个CMS是ESCMS的..现在我只能看到1/1页....其实我有1/3页呢...后面的两页看不到了...请问这是怎么回事啊?谢了... 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询