ASP Instance code: Get a long article pagination code

Source: Internet
Author: User

The following are the referenced contents:

<%
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 "Hint: wrong arguments!", "-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 "Hint: wrong arguments!", "-1"
Else
Response.Write Str (page-1) & "<br><br><center> divided into" &pcount& "page"
End If

For p = To UBound (str)
Response.Write "<a href=" &url& "p=" &p+1& ">[" &p+1& "]</a>"
Next
Response.Write "Current &abspage&"/"&pcount&" page </center>
End Sub
End Class

'------------------Call-----------------------
P=request. QueryString ("P")
str= "First page: This is the first page of content {nextpage} The second page: This is the content of the second page"
Url= "shownews.asp?id=" &id& "&"
Set Newpage=new aspxsky_page
Newpage.showpage Str,p,url
%>



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.