Oak
Oak

Reputation: 1169

Get number of clicked page in DataPager control

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

Answers (1)

adt
adt

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

Related Questions