asp实现留言板分页显示的部分代码,但执行到sub pages() 总是提示语法错误
发布网友
发布时间:2022-04-22 08:34
我来回答
共1个回答
热心网友
时间:2022-04-22 10:04
好像是多了三个End IF
<%
sub pages()
dim ii,p,n
if totalrec mod perpage=0 then
n= totalrec \ perpage
else
n= totalrec \ perpage+1
end if
if currentpage-1 mod 6=0 then
p=(currentpage-1) \ 6
else
p=(currentpage-1) \ 6
end if
response.write "<table border=0 cellpadding=0 cellspacing=3 width='86%' align=center ><form method=post action=index_main.asp>"&_
"<tr>"&_
"<td valign=middle align=right>页次:<b>"& currentPage &"</b>/<b>"& n &"</b>页, 每页<b>"& rs.PageSize &"</b>条, 共<b>"& totalrec &"</b>条 "
if currentPage=1 then
response.write "<font face=webdings>9</font> "
else
response.write "<a href='?page=1' title=首页><font face=webdings>9</font></a> "
end if
if p*6>0 then response.write "<a href='?page="&Cstr(p*6)&"' title=上十页><font face=webdings>7</font></a> "
response.write "<b>"
for ii=p*6+1 to P*6+6
if ii=currentPage then
response.write "<font size=4>"+Cstr(ii)+"</font> "
else
response.write "<a href='?page="&Cstr(ii)&"'>"+Cstr(ii)+"</a> "
end if
'end if '这里多了个End if
if ii=n then exit for
'p=p+1
next
response.write "</b>"
if ii<n then response.write "<a href='?page="&Cstr(ii)&"' title=下十页><font face=webdings>8</font></a> "
if currentPage=n then
response.write "<font face=webdings>:</font> "
else
response.write "<a href='?page="&Cstr(n)&"' title=尾页><font face=webdings>:</font></a> "
end if
'end if '这里多了个End if
'end if '这里多了个End if
response.write "</form></table>"
end sub
%>