All,
So I have upgraded my asp.net web application from asp.net 3.5 to asp.net 4.6.1. After the upgrade I discovered an issue with the GridView control, specifically paging issue. The GridView generates the following paging UI:
<< 1 2 3 ... >>
When you click << or the specific page numbers, all works fine. The problem is when you click >> to go to the last page, the NewPageIndex is zero.
In other words, when you handle PageIndexChanging event, the e.NewPageIndex returns 0 when you have clicked the '>>' go to the last page link.
Btw, I loaded the previous project (prior to upgrade, which was using .net 3.5) and loaded the same page and the GridView's last page link works correctly. So after the upgrade, only the last page option stopped working.
Here's my GridView code snippet:
<asp:GridView runat="server" ID="ctlSearchResultsGrid" SkinID="SearchResults"
AutoGenerateColumns="False"
AllowPaging="True"
OnPageIndexChanging="ctlSearchResultsGrid_PageIndexChanging">