CopyCode The Code is as follows: public void listarticle ()
{
Cmsarticle arobj = new cmsarticle ();
Dataset DS = arobj. listarticle ();
If (Ds! = NULL)
{
Pageddatasource PPS = new pageddatasource ();
PDS. datasource = Ds. Tables [0]. defaultview;
PPS. allowpaging = true;
PPS. pagesize = 1;
PDS. currentpageindex = currentpage-1;
Rscount = Ds. Tables [0]. Rows. count;
Pagecount = PPS. pagecount;
Pagesize = PPS. pagesize;
Gvnewlist. datasource = PDS;
Gvnewlist. databind ();
/// Up/down
Double result;
Result = rscount/pagesize;
String [] r = new string [2];
R = result. tostring (). Split ('.');
Pagecount = convert. toint32 (R [0]);
If (result> pagecount)
{
Pagecount = pagecount + 1;
}
/// Previous page and homepage
If (! PPS. isfirstpage)
{
Lnkprev. navigateurl = "? Page = "+ convert. tostring (currentpage-1 );
// Lnkhead. navigateurl = "? Page = "+ convert. tostring (1 );
}
/// Next and last pages
If (! PPS. islastpage)
{
Lnknext. navigateurl = "? Page = "+ convert. tostring (currentpage + 1 );
// Lnkend. navigateurl = "? Page = "+ convert. tostring (rscount );
}
}
Listinfolabel. Text = "all" + rscount + ", per page" + pagesize + ", current section" + currentpage + "/" + pagecount + "page ";
Pageinfoliteral. Text = webapp. pagination. Show (currentpage, pagecount, 10 ,"? Page = ","");
}