Custom Membership and Role Provider In ASP.NET

Put this into web.config file for removing default connection string

<connectionStrings>

<remove name="LocalSqlServer"/>

<add name="xyzConnectionString"

connectionString="Data Source=vsdotnet;

Initial Catalog=xyz;User Id=sa;Password=sa;"

providerName="System.Data.SqlClient"/>

</connectionStrings>

Put this in web.config file for membership providers.


<membership>

<providers>

<remove name="AspNetSqlMembershipProvider"/>

<add connectionStringName="xyzConnectionString"

enablePasswordRetrieval="false"

enablePasswordReset="true"

requiresQuestionAndAnswer="true"

applicationName="/"

requiresUniqueEmail="false"

passwordFormat="Hashed"

maxInvalidPasswordAttempts="4"

minRequiredPasswordLength="7"

minRequiredNonalphanumericCharacters="1"

passwordAttemptWindow="10"

passwordStrengthRegularExpression=""

name="AspNetSqlMembershipProvider"

type="System.Web.Security.SqlMembershipProvider,

System.Web, Version=2.0.0.0, Culture=neutral,

PublicKeyToken=b03f5f7f11d50a3a"/>

</providers>

</membership>


put this into web.config files for role provider


<roleManager enabled="true">

<providers>

<remove name="AspNetSqlRoleProvider"/>

<add connectionStringName="xyzConnectionString"

applicationName="/" name="AspNetSqlRoleProvider"

type="System.Web.Security.SqlRoleProvider, System.Web,

Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

<remove name="AspNetWindowsTokenRoleProvider"/>

</providers>

</roleManager>

Comments

Popular posts from this blog

How to create Rest API(Web API) with ASP.NET Core 1.0

Creating PDF with ASP.Net MVC and RazorPDF

Solution: gulp is not recognized as internal or external command- Visual Studio