ASP. NET Data Control Reference aspnetpager. dll pagination ASP. NET Data Control Reference aspnetpager. dll pagination

Source: Internet
Author: User
ASP. NET Data Control Reference aspnetpager. dll Paging

Today, we will share with you the following points: "ASP. NET data control references aspnetpager. dll paging:

1. It may be a bit elementary to explain. I hope that the experts will not "spray" me, because I know that not everyone is a master. I am also afraid that the experts will say that I am 13, and I am not a minor;

2. If there is anything wrong with it, I hope you can point out that you must learn it modestly;

3. This article is original to the author and respects the fruits of others' work. For more information, see the author. Thank you.

Let's start with the following:

Step 1: first download an aspnetpager. dll http://files.cnblogs.com/tandyshen/AspNetPager.rar

Step 2: Reference aspnetpager. dll in the bin folder of the project

Step 3: add the aspnetpager control in the toolbox,

Next

In this way, we have successfully added the aspnetpager control and dragged it to the page for use! → _ → Well, it's a step away from success...

Step 4:CodeFor example, the repeater control is used for other data controls, such as the gridview and datalist...

Front-end code:

 <Webdiyer: aspnetpager id ="Aspnetpager1"Runat ="Server"Pagesize ="10"  
Horizontalalign ="Center"Width ="100%"
Meta: resourcekey ="Aspnetpager1"Style ="Font-size: 14px"
Alwaysshow ="False"Firstpagetext ="Homepage"Lastpagetext ="Last page"Nextpagetext ="Next Page"
Prevpagetext ="Previous Page"Submitbuttontext ="Go"Submitbuttonclass ="Submitbtn"
Custominfostyle ="Font-size: 14px; text-align: left;"
Inputboxstyle ="Width: 25px; Border: 1px solid #999999; text-align: center;"
Textbeforeinputbox ="Go to"Textafterinputbox ="Page"Pageindexboxtype ="Textbox"
Showpageindexbox ="Always"Textafterpageindexbox ="Page"
Textbeforepageindexbox ="Go"Font-size ="14px"Custominfohtml ="Total & lt; font color = '# ff0000' & gt; % pagecount % & lt;/font & gt; pages, page <font color = '# ff0000'> % currentpageindex % </font>"
Showcustominfosection ="Left"Custominfosectionwidth ="19%"
Pagingbuttonspacing ="3px"Onpagechanged ="Aspnetpager1_pagechanged">
</Webdiyer: aspnetpager>

 

Background code:

 Private VoidDatasbind () 
{
This. aspnetpager1.recordcount = Ds. Tables [0]. Rows. count;
Pageddatasource PPS = new pageddatasource ();
PPS. allowpaging = true;
PPS. pagesize = aspnetpager1.pagesize;
PPS. currentpageindex = aspnetpager1.currentpageindex-1;
PDS. datasource = Ds. Tables [0]. defaultview;
Rpttandy. datasource = PPS;
Rpttandy. databind ();
}
Protected VoidAspnetpager1_pagechanged (ObjectSender, eventargs E)
{
Datasbind ();
}

The red part is the key code ~

Well, the above is what I shared with you today using aspnetpager. DLL's paging method for the Asp.net server controls. I think I have explained it in detail. There are not only text and code, but also images. At the top of it! This mainly paves the way for me to share with you my storage process paging next time. Please stay tuned!

PS: Tandy tang I wish you a pleasant write of your code!
 

As a member of the IT industry, we should be more professional.

Today, we will share with you the following points: "ASP. NET data control references aspnetpager. dll paging:

1. It may be a bit elementary to explain. I hope that the experts will not "spray" me, because I know that not everyone is a master. I am also afraid that the experts will say that I am 13, and I am not a minor;

2. If there is anything wrong with it, I hope you can point out that you must learn it modestly;

3. This article is original to the author and respects the fruits of others' work. For more information, see the author. Thank you.

Let's start with the following:

Step 1: first download an aspnetpager. dll http://files.cnblogs.com/tandyshen/AspNetPager.rar

Step 2: Reference aspnetpager. dll in the bin folder of the project

Step 3: add the aspnetpager control in the toolbox,

Next

In this way, we have successfully added the aspnetpager control and dragged it to the page for use! → _ → Well, it's a step away from success...

Step 4: In the code section, I use the Repeater control as an example. Other data controls, such as gridview and datalist, are used in the same way...

Front-end code:

 <Webdiyer: aspnetpager id ="Aspnetpager1"Runat ="Server"Pagesize ="10"  
Horizontalalign ="Center"Width ="100%"
Meta: resourcekey ="Aspnetpager1"Style ="Font-size: 14px"
Alwaysshow ="False"Firstpagetext ="Homepage"Lastpagetext ="Last page"Nextpagetext ="Next Page"
Prevpagetext ="Previous Page"Submitbuttontext ="Go"Submitbuttonclass ="Submitbtn"
Custominfostyle ="Font-size: 14px; text-align: left;"
Inputboxstyle ="Width: 25px; Border: 1px solid #999999; text-align: center;"
Textbeforeinputbox ="Go to"Textafterinputbox ="Page"Pageindexboxtype ="Textbox"
Showpageindexbox ="Always"Textafterpageindexbox ="Page"
Textbeforepageindexbox ="Go"Font-size ="14px"Custominfohtml ="Total & lt; font color = '# ff0000' & gt; % pagecount % & lt;/font & gt; pages, page <font color = '# ff0000'> % currentpageindex % </font>"
Showcustominfosection ="Left"Custominfosectionwidth ="19%"
Pagingbuttonspacing ="3px"Onpagechanged ="Aspnetpager1_pagechanged">
</Webdiyer: aspnetpager>

 

Background code:

 Private VoidDatasbind () 
{
This. aspnetpager1.recordcount = Ds. Tables [0]. Rows. count;
Pageddatasource PPS = new pageddatasource ();
PPS. allowpaging = true;
PPS. pagesize = aspnetpager1.pagesize;
PPS. currentpageindex = aspnetpager1.currentpageindex-1;
PDS. datasource = Ds. Tables [0]. defaultview;
Rpttandy. datasource = PPS;
Rpttandy. databind ();
}
Protected VoidAspnetpager1_pagechanged (ObjectSender, eventargs E)
{
Datasbind ();
}

The red part is the key code ~

Well, the above is what I shared with you today using aspnetpager. DLL's paging method for the Asp.net server controls. I think I have explained it in detail. There are not only text and code, but also images. At the top of it! This mainly paves the way for me to share with you my storage process paging next time. Please stay tuned!

PS: Tandy tang I wish you a pleasant write of your code!
 

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.