Follow me (@troygoode) on Twitter!
The starter kit currently consists of two things:
Out of the box, the starter kit gives you the following features:
Tips are welcome, but not expected.
Note: If you have an ASP.Net MVC 1.0 project, you can convert it to ASP.NET MVC 2.0 following these instructions: http://www.asp.net/learn/whitepapers/what-is-new-in-aspnet-mvc/#_TOC2
Build.Debug.bat
or Build.Release.bat
batch files.MvcMembership.dll
.SampleWebsite\Areas\UserAdministration
to {targetSite}\Areas
. (If no "Areas" folder exists in your target site, you can just add one.)Application_Start
shold call AreaRegistration.RegisterAllAreas()
.SampleWebsite\Content\MvcMembership.css
to {targetSite}\Content\
.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. Hint: Use C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe, and then grant your web site's application pool user access to the database.Authorize
attribute in the UserAdministrationController.cs
file (line 11) to whatever role you want to require a user to have in order to view/use the User Administration area. If a user tries to navigate to the User Administration area without this role, they will be redirected to the login page (even if they're already logged in).system.net/mailSettings/smtp
node in your web.config file with the appropriate SMTP settings so that emails can be sent for password change/reset events.global.asax
to keep the membership system updated with each user's last activity date:protected void Application_AuthenticateRequest()
{
if(HttpContext.Current.User != null)
Membership.GetUser(true);
}
Site.Master
in the \Views\Shared
folder. If you want to isolate something to the starter kit you could put it in \Areas\UserAdministration\Views\Shared
.Html.ActionLink("Home", "Index", "Home", new {Area = ""}, new {})
<% if (Roles.IsUserInRole("Administrator")){ %>
<li><%= Html.ActionLink("User Administration", "Index", "UserAdministration", new { Area = "UserAdministration" }, new { }) %></li>
<% } %>