主题:求助, 在ASP文件启用了多页面时,为什么我这个分页程序就不行了...
求助, 在ASP文件启用了多页面时,为什么我这个分页程序就不行了...
我使用了这个代码后,分页程序就出错,用单个ASP文件正常.
<%
Dim Action
Action=trim(request("action"))
Select Case Action
Case "DianNaoData"
Call DianNaoData()
Case "DianNaoUser"
Call DianNaoUser()
End Select
%>
<BODY>
<%
Sub DianNaoData
On Error Resume Next
%>
我是用这样的分页代码
<%
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
%>
<%
MaxPerPage=25
PageUrl=""
totalPut=rs.recordcount
if currentpage<1 then currentpage=1
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage totalput,MaxPerPage,PageUrl
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,PageUrl
else
currentPage=1
showContent
showpage totalput,MaxPerPage,PageUrl
end if
end if
rs.close
sub showContent
end sub
function showpage(totalnumber,MaxSpecialList,filename)
if totalnumber mod MaxSpecialList=0 then
n= totalnumber \ MaxSpecialList
else
n= totalnumber \ MaxSpecialList+1
end if
if Classid<>"" then
linkto="classid="&amp;Classid
else
linkto=""
end if
%>
<table border="1" align="center" cellpadding="3" cellspacing="0">
<tr>
<td align="center" class=TableRow2>编号</td>
<td align="center" class=TableRow2>客户姓名</td>
<td align="center" class=TableRow2>客户地址</td>
</tr>
<%
i=0
do while not rs.eof
i=i+1
%>
<tr>
<td align=center class=TableRow2><%=rs("Userid")%></td>
<td align=center class=TableRow2><%=rs("UserName")%></td>
<td align=center class=TableRow2 title='<%=rs("UserAdd")%>'><%=left(rs("UserAdd"),10)%></td>
</tr>
<%
if i>=MaxPerPage then exit do
loop
%>
</table>
这里就是显示上一步下一步的代码,
<%
end function
%>
出错的信息是:
Microsoft VBScript 编译器错误 错误 '800a03ea'
语法错误
/jkwl/Jkwl_DianNaoAllData.asp,行 107
sub showContent
^
我是新手,实在搞不懂了,翻书网上找答案,没收获, 启用了多页面的文件为什么不能使用这个翻页呢,要这样的代码可以翻页,希望高手帮助.谢谢
我使用了这个代码后,分页程序就出错,用单个ASP文件正常.
<%
Dim Action
Action=trim(request("action"))
Select Case Action
Case "DianNaoData"
Call DianNaoData()
Case "DianNaoUser"
Call DianNaoUser()
End Select
%>
<BODY>
<%
Sub DianNaoData
On Error Resume Next
%>
我是用这样的分页代码
<%
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
%>
<%
MaxPerPage=25
PageUrl=""
totalPut=rs.recordcount
if currentpage<1 then currentpage=1
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage totalput,MaxPerPage,PageUrl
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,PageUrl
else
currentPage=1
showContent
showpage totalput,MaxPerPage,PageUrl
end if
end if
rs.close
sub showContent
end sub
function showpage(totalnumber,MaxSpecialList,filename)
if totalnumber mod MaxSpecialList=0 then
n= totalnumber \ MaxSpecialList
else
n= totalnumber \ MaxSpecialList+1
end if
if Classid<>"" then
linkto="classid="&amp;Classid
else
linkto=""
end if
%>
<table border="1" align="center" cellpadding="3" cellspacing="0">
<tr>
<td align="center" class=TableRow2>编号</td>
<td align="center" class=TableRow2>客户姓名</td>
<td align="center" class=TableRow2>客户地址</td>
</tr>
<%
i=0
do while not rs.eof
i=i+1
%>
<tr>
<td align=center class=TableRow2><%=rs("Userid")%></td>
<td align=center class=TableRow2><%=rs("UserName")%></td>
<td align=center class=TableRow2 title='<%=rs("UserAdd")%>'><%=left(rs("UserAdd"),10)%></td>
</tr>
<%
if i>=MaxPerPage then exit do
loop
%>
</table>
这里就是显示上一步下一步的代码,
<%
end function
%>
出错的信息是:
Microsoft VBScript 编译器错误 错误 '800a03ea'
语法错误
/jkwl/Jkwl_DianNaoAllData.asp,行 107
sub showContent
^
我是新手,实在搞不懂了,翻书网上找答案,没收获, 启用了多页面的文件为什么不能使用这个翻页呢,要这样的代码可以翻页,希望高手帮助.谢谢