The post about paging in ASP.NET MVC still gets many hits, but the demo was created with ASP.NET MVC preview 5, so therefore I upgraded the demo to ASP.NET MVC Beta. I also removed a little bug that occurred when paging an already filtered list.
You can download the updated demo here.
Paging demo upgraded to ASP.NET MVC Beta
How can I open this in MS Visual Studio 2008 Express? The lib folder cannot be accessed. The reference to MvcPaging.dll is missing too. Could you please post an Express version of the demo? Thanks for these posts by the way!
Unfortunately, I don’t have VS 2008 Express installed, so no luck I’m afraid.
Tried to install VWD Express but it seems to nicely integrate into my VS 2008 Pro environment so I can’t get a clean VS 2008 Express environment.
Unfortunately I don’t have a proper VS 2008 Express environment, so I can’t create a solution.
But it isn’t too hard to copy the source into a VS 2008 Express solution is it?
This doesn’t seem to run in VS2008 with ASP.NET MVC RC1.
From RC, viewContext doesn’t inherit from RequestContext anymore. in the Pager.cs GeneratePageLink method, you have to change the line
var virtualPathData = RouteTable.Routes.GetVirtualPath(this.viewContext, pageLinkValueDictionary);
to:
var virtualPathData = RouteTable.Routes.GetVirtualPath(this.viewContext.RequestContext, pageLinkValueDictionary);
martijn: Thanks, it works now. Not sure why but I also had to point my references to the RC assemblies to get that new line of code to work.