Question

ASP.NET 4.0 and C#

I'm using the default membership provider with the SqlExpress DB that the ASP.NET had created for me, but I want to modify some settings.

So I went to the web.config file to search for the <Membership> and <default provider> to change the settings there, but I didn't find them!

I don't want to create a new provider. I just want to modify the existing one. Where are the settings?

Was it helpful?

Solution

Because it's the default using default values.

Below is an example. put it after <system.web>

<membership>
        <providers>
            <clear/>
            <add name="AspNetSqlMembershipProvider"
                connectionStringName="LocalSqlServer"
                enablePasswordRetrieval="false"
                enablePasswordReset="true"
                requiresQuestionAndAnswer="true"
                applicationName="/"
                requiresUniqueEmail="false"
                passwordFormat="Hashed"
                maxInvalidPasswordAttempts="5"
                minRequiredPasswordLength="7"
                minRequiredNonalphanumericCharacters="1"
                passwordAttemptWindow="10"
                passwordStrengthRegularExpression=""                     
                type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
        </providers>
    </membership>

OTHER TIPS

The default membership provider is configured in your machine.config. Either modify the settings in the web.config, or copy the settings from your machine.config to your web.config to customize it. You may need to add a <remove> element in the web config before re-adding it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top