This project is read-only.

1.0 (Mvc 1, Release)

Rating:        Based on 9 ratings
Reviewed:  8 reviews
Downloads: 8164
Released: Aug 7, 2009
Updated: Aug 9, 2009 by TroyGoode
Dev status: Stable Help Icon

Recommended Download

Source Code MvcMembership
source code, 1148K, uploaded Aug 7, 2009 - 8164 downloads

Release Notes

Project Description

The starter kit provides the Asp.Net MVC controllers, models, and views needed to administer users & roles.

What is the Asp.Net MVC Membership Starter Kit?

The starter kit currently consists of two things:
  1. A sample website containing the controllers, models, and views needed to administer users & roles.
  2. A library that provides testable interfaces for administering users & roles and concrete implementations of those interfaces that wrap the built-in Asp.Net Membership & Roles providers.
Out of the box, the starter kit gives you the following features:
  • List of Users
  • List of Roles
  • User Account Info
  • Change Email Address
  • Change a User's Roles

How do I use it?

In Asp.Net MVC 1 there isn’t a great story for packaging & sharing controllers, views, and other resources so we’ll need to follow a few manual steps:
  1. After getting the source code build it using your preferred IDE or using the included Build.Debug.bat or Build.Release.bat batch files.
  2. Grab the MvcMembership.dll assembly and place it wherever you’re including external libraries in your project. Add a reference to the assembly to your Asp.Net MVC application.
  3. Copy the UserAdministrationController.cs file from the SampleWebsite’s Controllers directory to your app’s Controllers directory.
  4. Copy the ISmtpClient.cs file, SmtpClientProxy.cs file, and UserAdministration folder from the SampleWebsite’s Models folder to your app’s Models folder.
  5. Copy the UserAdministration folder from the SampleWebsite’s Views folder to your app’s Views folder.
  6. Copy the MvcMembership folder from the SampleWebsite's Content folder to your app's Content folder.
  7. Run through the various .cs files and the views and change the namespaces from SampleWebsite.* to whatever is appropriate for your application.
  8. Make sure you’ve configured your web.config properly for Membership and Roles. If you aren’t sure of how to do this, take a look at the first two articles in this series by Scott Mitchell at 4GuysFromRolla.
  9. Finally, add the following code to your global.asax to keep the membership system updated with each user’s last activity date:
protected void Application_AuthenticateRequest()
    if(User != null)

What is new since the last release?

Well, the last release was for Preview 5, so at the very least the project has been updated for Beta and finally Release. Moreover, the project has been completely rewritten from scratch – a major undertaking that was the primary cause of the long delay between releases. Why the rewrite? Two reasons:
  1. The first release of the Starter Kit was for Preview 2 of the MVC framework. A lot changed between Preview 2 and Release – A LOT. A lot of the features of the first starter kit were rolled into the OTOB experience (such as login and registration), so I shifted the scope of the project more squarely into the realm of user & role administration. Unfortunately all of these major changes took a toll on the source – I was no longer happy working in the source as it was written for many reasons and thus wanted a rewrite. One of those reasons was…
  2. Previous releases had no (as in zero, less than one, nada) unit tests. This became increasingly unacceptable to me and trying to add unit tests after-the-fact was a nightmare. Instead I rewrote the project using TDD.
Alright, so that was basically the long-winded spiel to prepare you for the bad news: the project regressed from a functionality perspective. During the course of the rewrite things some things didn’t make it in – chief among them is the OpenID integration. I encourage everyone to take a look at the Maarten Balliauw (an MvcMembership contributor) blog post on authenticating via RPX in MVC.

Reviews for this release

It's a fantastic starting point as the name suggests. I upgraded it to MVC 2 with very little hassle and it works like a charm!
by kenlewisjr on Jun 23, 2010 at 8:32 PM
Admin section is pretty enought but user section is not. If user forget their password how can they get it. Also we need documentation ;o)
by promaxcoq on Apr 16, 2010 at 11:16 AM
Great!!! Just want to say that is does not work on shared hosting sites - still great! Good work.
by munkey11 on Apr 13, 2010 at 4:56 PM
This is great, just I was looking for
by serj1975 on Feb 17, 2010 at 10:08 AM
The sample code works well and introduces the MvcMembership gem. Great starting point for anyone like me, someone who just got around to Asp.Net MVC and Forms Authentication.
by rroman81 on Nov 17, 2009 at 7:12 AM
Very useful and academic. Keep the good work!
by RalphMartinez on Oct 1, 2009 at 4:23 AM
Downloaded the source, ran it, no problems. Nice example. Does everything it says on the tin. It also gave me hints on how to structure my MVC project which has been bugging me for days.
by junto on Aug 21, 2009 at 1:43 PM
Awesome! I had a couple of small issues that Troy helped me resolve, but other then that it pretty much worked out of the box. Great job Troy. Thanks for your hard work.
by putrtek on Aug 12, 2009 at 3:43 PM