ASP implementation of very long article content due to too long automatic page or manual paging

Source: Internet
Author: User
Tags manual end

The following is the content of several articles over the long implementation of the page source code.

' Manual Paging by identity
function Manualpage (str)
Pages=request. QueryString ("page")
Contentstr=split (str, "{$page $}")
Response.Write (CONTENTSTR (pages))
Response.Write ("<p/>")
Response.Write ("<div class=" "PageList" ">")
For i = 0 To UBound (CONTENTSTR)
Response.Write ("<a href= '? id=" &id& "&page=" &i& "' >" &i+1& "</a>")
Next
Response.Write ("</div>")
End Function



' Paging by length
function AutoPage (str,fontnum)
If Len (str) >fontnum Then
If Len (str) mod fontnum>0 then ' calculate total pages
Pagecontent=len (str) \fontnum+1
Else
Pagecontent=len (str) \fontnum
End If
Dim arr ()
ReDim arr (pagecontent)
for m = 1 to PageContent
If M<>pagecontent Then
Arr (m) = Mid (str, (m*fontnum-fontnum+1), Fontnum)
Else
Arr (m) = Mid (str, (m*fontnum-fontnum+1), Len (str))
End If
Next
If Request.QueryString ("page") <> "then
Response.Write (Arr (Request.QueryString ("page"))
Else
Response.Write (arr (1))
End If
Response.Write ("<p/>")
Response.Write ("<div class=" "PageList" ">")
For i = 1 to PageContent
Response.Write ("<a href=?id=" &id& "&page=" &i& ">" &i& "</a>")
Next
Response.Write ("</div>")
Else
Response.Write (str)
End If
End Function

=============================
In the page

<% 
                      if instr (Content, "{$page $}") =0  then  ' Determines if it is a manual paging flag, not an automatic paging
                      call autopage (content,2000)
                       else
                      call manualpage (Content)
                      end if
                        %>

If you need more relevant ASP paging information, there will be more relevant solutions available to you in Arisisi www.alixixi.com.
This site is recommended to use the Add Tag page, where you want to change, you can avoid the unreasonable phenomenon of the section break position.

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.