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 <font color= ' #ff0000 ' >%pagecount% </font> 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