Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extending AccountController: ASP.NET MVC Membership

The ASP.NET MVC 1.0 (final) project template has basic membership built in, but I need to extend it in two ways:

  • Email Confirmation to validate new accounts.
  • Additional fields on the registration view, such as "Home Street Address" and "Department Number"

I am planning to modify the template files such as Controllers/AccountController.cs and Views/Account/Register.aspx, but really I'm not sure where to start.

I have found many articles that somewhat apply (such as this one at aspnet.4guysfromrolla.com), but trying to implement an ASP.NET WebForms tutorial within ASP.NET MVC could be a waste of time if there is a better way to get started or an implementation already in ASP.NET MVC that closely fits my needs.

I'm just looking for general guidance on where to start.

like image 673
Robert Claypool Avatar asked May 18 '09 21:05

Robert Claypool


1 Answers

There's really not much different about the MVC framework, as it applies to the Membership provider. It's not quite as seamless but the functionality is similar. The ASP.NET membership is as close to a standard as the MVC platform has at the moment. But if you use the interface provided by the Membership service, you should be able to plug in your own membership or profile provider, if it becomes necessary.

Here is a blog entry for someone who implemented the email validation in MVC.

I prefer that the additional information be part of the application database but if you want it as registration information the ASP.NET Profile provider should work for you in MVC. There is an example in Part 6 of the series you have linked that should give you a good overview of the functionality. Here is an question from this site that may help you if you run into trouble getting it to work.

like image 89
Steven Lyons Avatar answered Nov 20 '22 22:11

Steven Lyons