CopyCode The Code is as follows: pageddatasource objpage = new pageddatasource ();
Dataview DV = bllbook. getlistbystate ("", true );
// Set the data source
Objpage. datasource = DV;
// Allow Paging
Objpage. allowpaging = true;
// Set the number of items displayed on each page
Objpage. pagesize = 10;
// Define variables to save the index of the current page
Int curpage;
Int recordcount;
Int pagecount = objpage. pagecount;
Recordcount = DV. count;
// Determine whether a page Jump request exists
If (request. querystring ["page"]! = NULL)
{
Curpage = convert. toint32 (request. querystring ["page"]);
}
Else
{
Curpage = 1;
}
// Set the index of the current page
Objpage. currentpageindex = curpage-1;
// Display status information
Lblcurpage. Text = "" + curpage. tostring () + "/" + pagecount. tostring () + "Page total" + recordcount. tostring () + "record ";
// If the current page is not the homepage
If (! Objpage. isfirstpage)
// Define the URL of the hyperlink "Previous Page" as the virtual path of the current execution page, and pass the index value on the next page
{
Lnkprev. navigateurl = request. currentexecutionfilepath + "? Page = "+ convert. tostring (curpage-1 );
Lnkfirst. navigateurl = request. currentexecutionfilepath + "? Page = "+ convert. tostring (1 );
}
// If the current page is not the last page
If (! Objpage. islastpage)
// Define the URL of the "next page" hyperlink as the virtual path of the current execution page, and pass the index value on the next page
{
Lnknext. navigateurl = request. currentexecutionfilepath + "? Page = "+ convert. tostring (curpage + 1 );
Lnklast. navigateurl = request. currentexecutionfilepath + "? Page = "+ convert. tostring (pagecount );
}
// Bind data
Repeater1.datasource = objpage;
Repeater1.databind ();