当前位置: 首页 > 图文教程 > 网络编程 > ASP > ASP实例代码:长文章分页代码设置方法

ASP
浅谈 ASP 模板技术之参数传递
九种防MDB数据库被下载的方法
如何采集静态文章系统
提供几个关于采集的函数(ASP)
ASP小偷(远程数据获取)程序的入门教程
远程图片自动按文件夹上传到服务器-默飞出品
纯编码实现Access数据库的建立或压缩
同一个帐号不能同时登陆的问题
跨越fso、wsh、 application写文件
用ASP设计购物推车
ASP中Web页面间的数据传递方式
ASP得到文件的大小类型最后修改时间
截取实际长度字符串,并用空格替换
本人常用的分页代码
一句话木马连接客户端
编写网页木马详解
Asp生成HTML方法大全
利用xmlhttp和adodb.stream加缓存技术下载远程Web文件
用ASP实现远程批量文件改名
如何准确定时运行ASP文件

ASP实例代码:长文章分页代码设置方法


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-08-14   浏览: 112 ::
收藏到网摘: n/a

 

以下为引用的内容:

<%
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> 共分为"&pcount&"页 "
  end if

  for p=0 to ubound(str)
 response.write "<a href="&url&"p="&p+1&">["&p+1&"]</a> "
  next
  response.write "当前第"&abspage&"/"&pcount&"页</center>"
 End Sub
End Class

'------------------调用-----------------------
p=request.QueryString("p")
str="第一页:这里是第一页的内容{nextpage}第二页:这里是第二页的内容"
url="shownews.asp?id="&id&"&"
set newpage=new aspxsky_page
newpage.showpage str,p,url
%>