一段asp手动分页问题,麻烦高手帮忙解决下
<%Classaspxsky_pagePrivateSubclass_initializeEndSubPublicFunctionAlert(message,gourl)...
<%
Class aspxsky_page
Private Sub class_initialize
End Sub
Public Function Alert(message,gourl)
message = replace(message,"'","\'")
If gourl="-1" then
Response.Write ("<script language=javascript>alert('" & message & "');history.go(-1)</script>")
Else
Response.Write ("<script language=javascript>alert('" & message & "');location='" & gourl &"'</script>")
End If
Response.End()
End Function
Public Sub showpage(str,page,url)
if not isnumeric(page) then
alert "提示:错误的参数!","-1"
end if
if page="" or page=0 or isnull(page) or isempty(page) then
page=1
else
page=cint(page)
end if
str=split(str,"[NextPage]")
abspage=page
pcount=ubound(str)+1
if page>cint(ubound(str)+1) or page<1 then
alert "提示:错误的参数!","-1"
else
response.write str(page-1)&"<br><br><center><font style='font-size:12px;LETTER-SPACING: 0px'> 共"&pcount&"页 "
end if
for p=0 to ubound(str)
response.write "<a href="&url&"p="&p+1&">["&p+1&"]</a> "
next
response.write "当前是第"&abspage&"页</font></center>"
End Sub
End Class
'------------------调用-----------------------
p=request.QueryString("p")
str=rst("ProductInfo")
url="chanpin_view.asp?productid="&id&"&"
set newpage=new aspxsky_page
newpage.showpage str,p,url
%>
这段代码能够正确显示分页内容,但当你点击1,2页时报错,麻烦高手指点下
文件名没有问题,就是这个,麻烦问下request请求具体哪里出现问题了呢 展开
Class aspxsky_page
Private Sub class_initialize
End Sub
Public Function Alert(message,gourl)
message = replace(message,"'","\'")
If gourl="-1" then
Response.Write ("<script language=javascript>alert('" & message & "');history.go(-1)</script>")
Else
Response.Write ("<script language=javascript>alert('" & message & "');location='" & gourl &"'</script>")
End If
Response.End()
End Function
Public Sub showpage(str,page,url)
if not isnumeric(page) then
alert "提示:错误的参数!","-1"
end if
if page="" or page=0 or isnull(page) or isempty(page) then
page=1
else
page=cint(page)
end if
str=split(str,"[NextPage]")
abspage=page
pcount=ubound(str)+1
if page>cint(ubound(str)+1) or page<1 then
alert "提示:错误的参数!","-1"
else
response.write str(page-1)&"<br><br><center><font style='font-size:12px;LETTER-SPACING: 0px'> 共"&pcount&"页 "
end if
for p=0 to ubound(str)
response.write "<a href="&url&"p="&p+1&">["&p+1&"]</a> "
next
response.write "当前是第"&abspage&"页</font></center>"
End Sub
End Class
'------------------调用-----------------------
p=request.QueryString("p")
str=rst("ProductInfo")
url="chanpin_view.asp?productid="&id&"&"
set newpage=new aspxsky_page
newpage.showpage str,p,url
%>
这段代码能够正确显示分页内容,但当你点击1,2页时报错,麻烦高手指点下
文件名没有问题,就是这个,麻烦问下request请求具体哪里出现问题了呢 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询