Derin
Derin

Reputation: 135

How to identify which Page number was clicked in DataPager

I have a listview and DataPager control. Now when I click a page number on the DataPager, the

ListView1_PagePropertiesChanging(object sender, PagePropertiesChangingEventArgs e)

event is fired. Now, I would like to identify which page number of the DataPager was clicked. For example, if Page 3 was clicked, then I would like to get the value 3. How can I do this?

Thanks in advance.

Upvotes: 0

Views: 1253

Answers (2)

you can try a code like this.

  protected void ListView1_PagePropertiesChanging(object sender, PagePropertiesChangingEventArgs e)
    {
        int pageindex = e.StartRowIndex / e.MaximumRows;
    }

Upvotes: 1

Ron Harlev
Ron Harlev

Reputation: 16673

The PagePropertiesChangingEventArgs as members that have some of the information you might need

Upvotes: 0

Related Questions