Reputation: 1169
I have a Listview
and a DataPager
control on my page and I'm trying to create a custom paging (listview shows only interval of results). When user clicks on any page, DataPager_PreRender()
event fires which contains my datasource/databind method.
Please tell me how to get the number of page that was clicked in datapager to use it in the PreRender
method.
Upvotes: 2
Views: 1644
Reputation: 4360
protected void ListView1_PagePropertiesChanging(object sender,PagePropertiesChangingEventArgs e)
{
int CurrentPage = (e.StartRowIndex / e.MaximumRows)+1;
Response.Write(CurrentPage.ToString());
}
http://forums.asp.net/p/1391359/2974778.aspx
Hope this helps.
Upvotes: 2