网络编程
位置:首页>> 网络编程>> Asp编程>> 如何在页面中快捷地添加翻页按钮?

如何在页面中快捷地添加翻页按钮?

  发布时间:2010-06-26 12:33:00 

标签:按钮,翻页,asp

如何在页面中快捷地添加翻页按钮?
 
    先编写一个nextprev.inc文件,再将代码< !--#include file="nextprev.inc"-->放在每个页面,简单吧?

nextprev.inc文件的内容如下:
   

< %
    Set Link=Server.CreateObject("MSWC.NextLink")
    count=Link.GetListCount("conlink.txt")
' GetListCount(file)  统计超级链接个数
    current=link.GetListIndex("conlink.txt")
' GetListIndex(file)  取得当前页的索引
    If current > 1 Then
      %>
      < a href="< %= Link.GetPreviousURL("conlink.txt") %>">上一页< /a>
' GetPreviousURL(file)  取得上一页的URL
      < %
    End If
    If current < count Then
    %>
    < a href="< %= Link.GetNextURL("conlink.txt") %>">下一页< /a>
' GetNextURL(file)  取得下一页的URL
    < % End If %>

另外,Content Linking组件的用法还有:
GetPreviousDescription(file) :取得上一页的说明行;
GetNthDescription(file,n):取得第n页的说明行;
GetNextDescription(file):取得下一页的说明行;
GetNthURL(file,n):取得第n页的说明行。
   

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com