Add custom fields to MVC4 simple membership

I am currently in the process of migrating all the blog content of this site over to my other site which is dedicated to all Information Technology , and is more focused on Software Development, Software Engineering and technology in general.

You will be able to find this post at the following URL

http://www.threenine.co.uk/blog/add-custom-fields-to-mvc4-simple-membership/

 

We will be repurposing FitGeekDad over the next few months and it will be undergoing some very exciting updates!

 

Posted in ASP.net MVC, C#, Programming, Tips & Tricks, Web Development Tagged with:
  • fguigui

    And is it possible to add tables (simply) to the membership ?

    • http://www.fitgeekdad.com/ Gary Woodfine

      Apologies for the delay. For some reason I wasn’t notified of comments.

      I don’t understand your question? In what way do you want to add tables the membership?

      • fguigui

        because sometime your application is just a management of users (membership) for which you just have to add some tables. Everything is then in the database membership.
        I’ve experienced it was difficult (impossible ?) to access these added tables by entity-framework access with a different connectionstring of the connectionstring of the simplemembership;
        Then that simplemembershipprovider can’t help if you want to access added tables to membership database

        • http://www.fitgeekdad.com/ Gary Woodfine

          I can say that I have not experienced that problem. I have created a database schema and used the SimpleMembership provider to access only the required membership tables, but have still used the same connection string to access other tables in the Schema for the information and functionality.

          Granted I couldn’t say access the “Company” table by using the SimpleMembership provider, but that is OK, because the SimpleMembership provider is not used to access that, it is purely used for Access and Simple Account Management. It’s up to you to implement the more complex functionality by using your own implementation.

          • fguigui

            I ‘ll add, sometime users data and applications data are too intricated to be in 2 differents db.
            You perhaps know aspnet_regsql (tool to create a membership database), it ask you if you want a separate db or a common db for your membership and your application.

  • René López

    Hey thank you so much for this awesome post, I’m just starting to grasp MVC 4 and simple membership and I was asking myself how can I add more fields to the default Register Model, so now that I found your post, you explain it in 5 easy steps, thanks a lot, I’ll make sure to fallow your future posts.

    • http://www.fitgeekdad.com/ Gary Woodfine

      Thanks! I need to get back into the habit of posting again :-)

  • jjspierx

    Thanks so much! Your steps made it easy and clear for me to add additional user information on registration! Much appreciated!

    • http://www.fitgeekdad.com/ Gary Woodfine

      Thanks for the feedback! Glad it helped, my goal achieved of helping at least one person :-)

  • kingkong balinggao

    Thank you very much for this. :)

Follow me on Twitter

%d bloggers like this: