ASP common Paging Class

Source: Internet
Author: User
Tags define set background
Paging

the attributes and methods of a class

This is an ASP common paging class. You can use it to easily page the recordset, of course, there are many paging classes and paging functions on the web. This page includes Getconn, Getrs, SQL, URLs, Cssfile, Fldname, Fldnote, Fldwidth, Fldalign, Showpagetype, Tleftcolor, Tlewidth, PageSize, Showwidth, Init, Pages, ShowData, Close, and other properties and methods.
1.GetConn property: Used to get a created connection object.
2.GetRS property: Used to get a created Recordset object, and if you set this property, you do not need to set the SQL property.
3.SQL Properties: Automatically create a Recordset object based on incoming SQL statements
4.PageSize Property: Set the number of record bars on page
5.FldName property: If you need to display the data in the library (that is, call the ShowData procedure), be sure to set this property. It is used to get the correct field name that needs to be displayed.
6.FldNote attribute: Sets the Chinese description of the corresponding field name, which needs to correspond to the field name one by one in Fldname.
7.FldWidth Property: Sets the width of the cell that displays the corresponding field data, corresponding to the field name one by one in Fldname.
8.FldAlign Properties: Sets the alignment of the cells that display the corresponding field data to correspond to the field name one by one in Fldname.
9.TleBGColor procedure: Sets the background color of the data title bar. If you want to display data, you can set this option.
10.TleFTColor property: Sets the font color for the data title bar.
11.TleWidth Property: Sets the width of the data title bar, which can be set when horizontal.
12.ShowPageType Property: Sets the display type of the pagination bar. There are Chinese characters, characters, English points.
13.ShowType Properties: Sets the type of data display, two kinds of horizontal and vertical.
14.ShowWidth Property: Sets the width of the table when the data is displayed.
15.CSSFile property: Sets the corresponding CSS file name and relative path.
16.URL Property: Sets the file address of the link in the pagination bar.
17.Init Process: page-class initialization data.
18.ShowData process: Displaying data.
19.Pages process: Displaying the page-bar
20.Close process: End of pagination class

second, the class source code (inc_clspage.asp)

<%optionexplicit
'/************************************************
'*                       *
' *name:asppagnationclass *
' *author:sunway *
' *version:v2.0 *
' *time:2003-12-26 *
' *email: *
' *homepage:none (maybesoon) *
' *notice:youcanuseandmodifyitfreely,*
' * Butpleaseholdthisitem. *
' * ifyoumodifyitthatihopeyou*
' * cansendamailforme. *
'*                       *
'************************************************/

' ######## #声明变量 #########
' Swstyleclass
Privatesw_strbtnclass,sw_strtxtclass,sw_strbgcolor,sw_inttbwidth,sw_intbdkind,sw_strbgimage,sw_strftcolor,sw_ Strbdcolor,sw_strshowwidth
' ######## #初始化变量 ##########
Sw_strftcolor= "#000000" ' FontColor
Sw_strbgcolor= "#FFFFFF" ' BackgroundColor
Sw_intbdkind=1 ' Defaultborderkindis "Thinborder".
Sw_inttbwidth= "98%" ' Table ' swidth.
Sw_strbdcolor= "#000000" ' Table ' Sbordercolor.

' Swpageclass
Privatesw_blnerrorflag,sw_blnishavers,sw_strfields
' ######## #初始化变量 ##########
Sw_blnerrorflag=false ' Set error flag is Fasle, is no error state
Sw_blnishavers=false ' Set recordset Fetch flag is Fasle, there is no recordset state
Sw_strshowwidth= "90%"
Sw_strfields = ""

' Define the display type of the link
Constsw_intshowchinese = 0 ' Chinese characters, such as "previous page, next page"
Constsw_intshowenglish = 1 ' English, such as "Back, Next"
Constsw_intshowcharacter = 2 ' special characters
' Constsw_intshowimage = 3 ' picture
' Define the display type of the data
Constsw_inthorizontalview=0 ' Yoko
Constsw_intverticalview = 1 ' Vertical row
' The display type of the line
Constsw_intshowbigborder = 2 ' thick line
Constsw_intshowsmallborder=1 ' thin Line
Constsw_intshownoborder = 0 ' wireless

' Number of pages displayed
Constsw_intshowpages =10

  ' *****************************************
  ' type:  class
  ' Purpose:  control the style displayed for paging information
  ' *****************************************
 classswstyle
   ' ***********************
  ' type:  properties
   ' Purpose:  set background color
   ' input:  a_strbgcolor :  background color.
   ' return:  none
   ' *****************************************
   Publicpropertyletbgcolor (a_strbgcolor)
    sw_strbgcolor=a_strbgcolor

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.