I'm trying to implement asp.net membership (forms version) using VS2012 and MVC4. I've created the database tables using aspnet_regsql.exe and now I want to configure the web.config so I can run the 'asp.net configuration' utility in visual studio. It seems I might be needing to use 'simplemembership'. Is this correct, and where can I get instructions on how to configure whichever one I need? Thank you
Asked
Active
Viewed 246 times
0
-
You can use anyone of them, I am using sqlmembership provider in vs2012 mvc4 app, coz I have my customised functions which I have been using in mvc2 and mvc3 apps for membership and role management. can u post your web.config file so that I can help u? – Niraj Jan 01 '13 at 07:56
1 Answers
0
By default ASP.NET MVC 4 uses the SimpleMembership provider which is a lightweight version of the full provider. It doesn't expose all the functionality of the full version.
The membership provider that you want to use is configured inside the <membership>
section of your web.config.
So for example if you wanted to configure the full membership provider (as used in MVC 3):
<membership defaultProvider="DefaultMembershipProvider">
<providers>
<add name="DefaultMembershipProvider"
type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
connectionStringName="DefaultConnection"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
requiresUniqueEmail="false"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="6"
minRequiredNonalphanumericCharacters="0"
passwordAttemptWindow="10"
applicationName="/"
/>
</providers>
</membership>

Darin Dimitrov
- 1,023,142
- 271
- 3,287
- 2,928
-
I already have that much, which I copied from an older project. I also have the equivalent
and a connection string set in – Bobbler Dec 31 '12 at 08:13applied to both. The error is "Could not load file or assembly 'System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies". Before I try to fix this, would I be better using the SimpleMembership provider? -
Whether you should use the SimpleMembershipProvider is an answer I cannot give you. You should decide based on your requirements. As I said the SimpleMembership provider is a stripped down version of the full provider. So if you don't need all the functionality of the full provider you could use it of course. – Darin Dimitrov Dec 31 '12 at 08:14