Pagenavigater 2.0 (including ASP. NET demo)

Source: Internet
Author: User
Pagenavigater 2.0.
Sinoprise technology Studio
Copyright (c) 2008 Kevin Yin
Http://www.sinoprise.cn
Http://www.sinoprise.com
This script can be used freely as long as all copyright messages are intact.
// ================================================ ======================: Http://www.sinoprise.cn/showtopic-26.aspx or in csdn site resource search forum: http://www.sinoprise.cn/

Updated: 2008/01/28
Pagenavigater 2.0.
Javascript pagination control 2.0
Previously, paging controls are related to related technologies. This is a page control written in JavaScript and has nothing to do with server-side technologies, such as ASP, ASP. NET, PHP, and JSP.
Output Information in the corresponding area;
Call method:
Use Dynamic Web language to output the following code on the HTML interface:
<Script language = "JavaScript">
Pager = new pagenavigater (20,255, 1, "http://www.sinoprise.cn/default.aspx ","? "," Pageindex ");
Document. Write (PAGER );
</SCRIPT>
You can.
Parameters of pagenavigater:
The first parameter, 20 in the preceding example, indicates the number of data entries on a page.
The second parameter, 255 in the preceding example, indicates the total number of data records.
The third parameter, 1 in the preceding example, indicates that the current page is 1st pages.
The fourth parameter, "http://www.sinoprise.cn/default.aspx" in the preceding example, indicates the destination address of the paging control navigation.
The fifth parameter, "?" in the preceding example, It indicates the delimiter between the paging variable and other variables. If it is the first parameter, the separator should be "?".
If it is a separator, that is, there are other variables before this variable, the separator should be "&"
The sixth parameter, "pageindex" in the preceding example, represents the variable during paging to specify the paging number, which is dynamic on the server.
You can obtain the user's navigation page by using this parameter on the webpage.
Pagination controls form groups such as: http://www.sinoprise.cn/default.aspx? URL of pageindex =...
ASP. NET example:
Encoding:
...................
Protected int _ recordcount = 531;
Protected int _ currentpage = 0;
Protected int _ pagesize = 25;
Protected string _ pageurl = "http: // localhost: 33167/default. aspx ";
Protected string _ splitstring = "? ";
Protected string _ pagevariable = "pageindex ";
Protected void page_load (Object sender, eventargs E)
{
String CP = request. querystring [_ pagevariable];
If (null! = CP)
_ Currentpage = convert. toint32 (CP );
Else
_ Currentpage = 1;
}
....................

HTML code:
Script Language = "JavaScript">
Pager = new pagenavigater (<% = _ pagesize %>, <% = _ recordcount %>, <% = _ currentpage %>, "<% = _ pageurl %> ", "<% = _ splitstring %
> "," <% = _ Pagevariable %> ");
Document. Write (PAGER );

</SCRIPT>

Compared with the first version, the following changes are made:
1. Extract the style sheet from the code for easy modification
2. Change the paging control style to the modern style.
3. Add paging jump
4. Fixed the bug where the page list is incorrectly displayed.

Note: This paging control depends on the style sheet definition. Here is a demo of the style sheet definition:

. Pagenavigater {
Font-size: 12px;
Font-style: normal;
Font-family: Arial, Helvetica, sans-serif;
Text-align: right;
List-style-type: none;
Margin-bottom: 5px;
Padding-Right: 5px;
Padding-left: 5px;
Padding-bottom: 5px;
Padding-top: 5px;
Line-Height: 20px;
Text-align: right;
Float: right;
Color: #006aa7;
}
. Pagenavigater {
Color: #006aa7;
Text-Decoration: none;
}
. Pagenavigater A: hover {
Color: # f60;
Text-Decoration: underline;
}
. Pagenavigater IMG {
Border-top-width: 0px;
Border-left-width: 0px;
Border-bottom-width: 0px;
Vertical-align: middle;
Border-right-width: 0px;
}
. Pagenavigateritem {
Border-Right: # b2bfcf 1px solid;
Border-left: # b2bfcf 1px solid;
Border-bottom: # b2bfcf 1px solid;
Border-top: # b2bfcf 1px solid;
Padding-Right: 6px;
Padding-bottom: 0px;
Padding-left: 6px;
Padding-top: 0px;
Display: block;
Background: # FFF; float: left;
Line-Height: 22px;
Margin-Right: 4px;
Height: 22px;
Vertical-align: middle;
}
. Pagenavigateritem input {
Font-size: 12px;
Font-family: Arial, Helvetica, sans-serif;
List-style-type: none;
Border-Right: # bdc5ca 0px solid;
Border-top: # 6f787e 0px solid;
Border-left: # 6f787e 0px solid;
Border-bottom: # bdc5ca 0px solid;
Padding-bottom: 3px;
Padding-left: 2px;
Padding-Right: 2px;
Padding-top: 3px;
Background: None transparent scroll repeat 0% 0%;
Width: 20px;
Line-Height: 16px;
Height: 14px;
Vertical-align: middle;
}
. Pagenavigater # focus {
Border-Right: # 1d619c 1px solid;
Border-top: # 1d619c 1px solid;
Background: # 1972bd;
Border-left: # 1d619c 1px solid;
Color: # FFF;
Border-bottom: # 1d619c 1px solid;
}

You can modify the style sheet as needed, but you cannot change the name of the style sheet (unless you change the code together)

// ================================================ ======================
Updated: 2008/01/24
Pagenavigater 1.0.
Javascriptsplit page control 1.0(page-navigater_v_1.0.0.zip)
Previously, paging controls are related to related technologies. This is a page control written in JavaScript and has nothing to do with server-side technologies, such as ASP, ASP. NET, PHP, and JSP.
Output Information in the corresponding area;
Call method:
Use Dynamic Web language to output the following code on the HTML interface:
<Script language = "JavaScript">

Pager = new pagenavigater (20,100 0000, 243, "right", http://www.sinoprise.cn /);
Document. Write (PAGER );
</SCRIPT>
You can.
Pnv_2.0.jpg(46.51 K) parameter information about pagenavigater from 16:16:41:
The first parameter, 20 in the preceding example, indicates the number of data entries on a page.
The second parameter, 1000000 in the preceding example, indicates the total number of data records.
The third parameter, 243 in the preceding example, indicates that the current page is 243rd
The fourth parameter, "right" in the preceding example, indicates the right alignment of the table in the paging control (that is, the right side of the page)
The fifth parameter, http://www.sinoprise.cn/in the example above, will be generated
Http://www.sinoprise.cn /? Pageindex =... link address, dynamic on the server side
Retrieve the pageindex parameter on the webpage to obtain the user's navigation page.
: Http://www.sinoprise.cn/showtopic-22.aspx

 

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.