ASP Common article paging function (non-recordset pagination)

Source: Internet
Author: User
Tags empty
Pagination | function | Recordset Description:
This function is a page for the article, not a recordset paging
This function implements pagination of the article and displays each page with a specified length
This function implementation does not need to specify a URL, automatic replacement URL
This function implementation returns multiple results, for: page links-Article statistics-article content, implemented by the dictionary
If the paging size is greater than the total size of the article, the paging link will be empty.

Display such as:
1th Page 2nd page 3rd page 4th page 5th page
50,000 words/Page 1/5 page Total 235,289 characters
Body...

Note: Three elements that display content are free to change position.

Note:
If you are looking for a recordset paging function, I also wrote a previous one, called "ASP VBScript paging function by STABX, Third edition".
Link:

Shawl.qiu
2006-09-04


Main content: Paging function and calling code
LineNum
  • <%
  • Dim rs, DiC
  • Set Rs=createobject ("Adodb.recordset")
  • Rs.Open "SELECT * from Ctat where aid=15783", Conn
  • ' Rs.Open ' select * from Ctat where aid=12850, conn
  • Set Dic=fatpgnt (RS ("content"), 50000,request.querystring ("Apid")
  • Response.Write DiC ("Pgnt") & "<br/>"
  • Response.Write DiC ("info") & "<br/>"
  • Response.Write DiC ("CNT") & "<br/>"
  • Set dic=nothing
  • Rs.close
  • Set rs=nothing
  • function Fatpgnt (Astr,psize,rid)
  • ''''''''''''''''''''''''''''''''''''''''''''''''''''''
  • ' ASP common article paging function (non-recordset paging), returns multiple results, dictionary implementation by Shawl.qiu
  • '
  • ' 2006-09-04
  • '''''''''''''''''''''''''''
  • ' Input parameter Description:
  • ' AStr is the string to be paged
  • ' Psize for each page size number
  • ' RId is the URL parameter ID, default is Apid, defined by the Rname variable in the function
  • '''''''''''''''''''''''''''
  • ' Output parameter Description:
  • ' Obj (' pgnt ') page links for articles
  • ' obj (' info ') for article statistics
  • ' obj ' ("cnt") is the content of the article
  • '''''''''''''''''''''''''''
  • ' Sample call:
  • '''''''''''''
  • ' Dim rs, dic
  • ' Set Rs=createobject (' Adodb.recordset ')
  • ' Rs.Open ' select * from Ctat where aid=15783, conn
  • '
  • ' Set Dic=fatpgnt (RS ("content"), 50000,request.querystring ("Apid"))
  • ' Response.Write dic ("Pgnt") & "<br/>"
  • ' Response.Write dic ("info") & "<br/>"
  • ' Response.Write dic ("CNT") & "<br/>"
  • ' Set dic=nothing
  • '
  • ' Rs.close
  • ' Set rs=nothing
  • ''''''''''''''''''''''''''''''''''''''''''''''''''''''
  • If IsNumeric (psize) =false or Len (aStr) =0 then Exit function
  •         if isnull (rId)  or rid= " or  IsNumeric (rId) =false then rid=1  ' If the paging query ID is empty then  id is  1

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.