I'm currently working on upgrading an existing ASP.NET 3.5 app to ASP.NET 4 and I found a rather odd behavior with a ListView and DataPager. I'm using a ListView with an ObjectDataSource and in the ListView I have a DataPager with a NumericPagerField. On my 3.5 web app the page will display the ListView properly and will display the page number links at the bottom, where the DataPager is located. If I go to the last page and delete row by row until all are gone, the ListView will automatically page to the previous page. This is all behavior out-out-the-box since I don't have any special code for paging.
When I run the same app on ASP.NET 4 the behavior changes. The ListView no longer automatically pages to the previous page and I'm left with an empty list, with no way to get back to the previous pages even though there is still data to be retrieved. I get no DataPager control at the bottom because at this point what the ListView is displaying is the EmptyDataTemplate.
The way I've been able to reproduce this is by creating two web apps as follows:
Using Visual Studio 2010 Premium (a release version, not a demo or preview)
Create an empty web application (I called mine WebApplication1) using ASP.NET 3.5 and create a new web form called WebForm1.aspx
Use the following code:
<%@ Page L
View Complete Post