ASP. NET Data Control Reference AspNetPager.dll paging

Source: Internet
Author: User

Share with you Today "ASP. AspNetPager.dll Paging" first declares the following points:

1, perhaps the explanation is a little beginner, I hope the master do not "spray" me, because I know that not everyone is a master, I am also afraid of the experts said I installed 13, niche;

2, if there is anything wrong, but also hope that everyone pointed out, must be open-minded to learn;

3, this article belongs to the author original, respect for the work of others, reproduced please indicate the author, thank you.

Here's the lecture:

First step: The first is to download a AspNetPager.dll Http://files.cnblogs.com/tandyshen/AspNetPager.rar

Step Two: Reference AspNetPager.dll under the project's Bin folder

Step three: Add the Aspnetpager control in the Toolbox,

and then

In this case we have successfully added the Aspnetpager control, drag it to the page to use it! →_→, well, it's a step away from success ...

Fourth step: In the Code section, I use the Repeater control as an example, other data controls, such as GridView, DataList, etc. ...

Front Code:

<webdiyer:aspnetpager id="AspNetPager1"Runat="Server"Pagesize="10"
horizontalalign="Center"Width="100%"
meta:resourcekey="AspNetPager1"Style="Font-size:14px"
alwaysshow="False"Firstpagetext="Home"Lastpagetext="Last"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 Page"Textafterinputbox="Page"Pageindexboxtype="Textbox"
showpageindexbox="Always"Textafterpageindexbox="Page"
textbeforepageindexbox="Go to"Font-size="14px"Custominfohtml= " total &lt;font color= ' #ff0000 ' &gt;%pagecount% &lt;/font&gt; page, section <font color= ' #ff0000 ' >%CurrentPageIndex%</font> page "
Showcustominfosection= "left" custominfosectionwidth= "19%"
Pagingbuttonspacing=" 3px" Onpagechanged= "aspnetpager1_ Pagechanged </webdiyer:aspnetpager>

Background code:

Privatevoid Datasbind ()
{
This. Aspnetpager1.recordcount = ds. Tables[0]. Rows.Count;
PagedDataSource PDS = new PagedDataSource ();
Pds. AllowPaging = true;
Pds. PageSize = aspnetpager1.pagesize;
Pds. CurrentPageIndex = aspnetpager1.currentpageindex-1;
Pds. DataSource = ds. Tables[0]. DefaultView;
Rpttandy. DataSource = PDS;
Rpttandy. DataBind ();
}
protected void aspnetpager1_pagechanged (object sender, EventArgs e)
{
Datasbind ();
}

The red part is the key code OH ~

Well, the above is what I share with you today with the AspNetPager.dll of the ASP. NET server control paging method, I think my explanation is enough detailed, there are not only text and code, as well as pictures, the top one! This is mainly for my next time with you to share their own write stored procedures page to do a cushion, please look forward to Oh!

Ps:tandy Tang Wish everyone write code happy!

ASP. NET Data Control Reference AspNetPager.dll paging

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.