0

I'm looking to have something like a profile provider in my ASP.NET MVC 4 that is using SimpleMembership. Correct me if I'm wrong by I don't think they've included the profileProviders into the simpleMembership yet. (I was not able to find an example of it anyways)

What I need is to be able to store user specific information (Email, Account number, etc...) that are needed often and easily retrieve them from anywhere in the application (views, controllers etc)

How can I do this? what is the best practice? I'm quite new to the platform and am learning everyday so sorry if this question has been asked before. I was not able to find it.

hjavaher
  • 2,589
  • 3
  • 30
  • 52

1 Answers1

0

If you're new to the framework you should probably start reading up on some of the more basic features before you go slightly deeper into things like role providers etc. A good place to start is the ASP.NET MVC tutorials. There's lots of other good tutorials that you'll be able to find with a search.

The MVC4 internet template provides you with a UserProfile model out of the box that integrates Simple Membership. The UserProfile class has properties for common user attributes such as username, email, password etc.

You can add more attributes to the model to meet your requiurements. A tutorial on how to do so can be found here. Look for the section where the author explains adding Custom User Properties. This tutorial also touches on Simple Membership.

MattSull
  • 5,514
  • 5
  • 46
  • 68
  • Hi Matt, Thank you for the reply. I mis-spoke, I was looking for a way to cache the information somehow so the system doesn't have to go to the database for that on every page load as I would like to display the company account number, customer account number... on every page (on the shared layout) -- thank you again – hjavaher Mar 28 '13 at 17:26