Tag Archives: ASP.NET MVC

MVC Pager update: now with AJAX support

The MVC pager now has support for AJAX scenario’s, thanks to Bart Lenaerts. This was my first GitHub pull request and everything went pretty smoothly.

Check out the demo application for an example. Visit the GitHub project page to download the solution.

MVC Pager update

Just a short message to let you know that the MVC Pager demo is upgraded to ASP.NET MVC3 and VS 2010. Get it at https://github.com/martijnboland/MvcPaging.

Raven DB ASP.NET Membership Provider

During the last year I’ve been looking at various NoSQL databases. I’m particularly interested in the flexibility (no fixed schema) and I don’t care that much for scalability that some of these databases provide, therefore I focused on document databases like CouchDB, MongoDB and Raven DB.

After some reading, I decided it was time for an experiment and took Raven DB to create an ASP.NET membership provider. The main reason I chose Raven DB is that you can run it embedded in your .NET application (for example in ~/App_Data) without a separate server and it’s even possible to run the entire database in-memory, which is ideal for tests.

The result of the experiment can be found at https://github.com/martijnboland/RavenDBMembership. It’s a VS 2010 solution with the membership provider, some integration tests and an ASP.NET MVC 3 sample app. You can also directly download it from here.

Disclaimer:

I’m not sure that creating a Membership provider was the right thing to do to experience NoSQL. Sure, the provider works, but the Membership API forces you into a direction that isn’t necessarily suitable for document databases and there might be some NoSQL anti-patterns here and there in the code

Oh, and the ASP.NET MVC sample app extends the Membership mess that comes with the default MVC project template. Don’t take this as some best practices example.

Entity Framework 4 Code-First demo updated to Feature CTP3

The EF 4 code-first demo has been updated to reference the EF4 Feature CTP3 dll at its default location. To run the demo, you have to make sure that the you have it installed. Download the EF 4 Feature CTP3 at http://www.microsoft.com/downloads/details.aspx?FamilyID=af18e652-9ea7-478b-8b41-8424b94e3f58&displayLang=en.

Although the demo was originally developed with VS 2010 Beta 2 everything works perfectly fine on VS 2010 RTM.

You can find the demo sources at github: http://github.com/martijnboland/EF4-codeonly-demo where it’s also possible to download the sources all at once.

Paging demo for ASP.NET MVC 2

During work, I discovered that the pager that I created a while ago didn’t work properly when using ASP.NET MVC2 area’s. The links that were generated didn’t count for the current area that the controller and views were in, resulting in wrong urls. Luckily the ASP.NET MVC team also ran into this issue and created an GetVirtualPathForArea() extension method on RouteCollection. Calling this one, instead of GetVirtualPath() made things work properly in area’s.

You can get the code for ASP.NET MVC 2 at http://github.com/martijnboland/MvcPaging/tree/mvc2 (mvc2 branch of the MvcPaging repository).