Wednesday, July 12, 2006

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>

Share:

0 comments:

Post a Comment

Your feedback is very important to me. Please provide your feedback via putting comments.

Search This Blog
About Me
My Photo

Full Stack Developer,Blogger,Microsoft Mvp, Mentor, Life long learner, 10+ Years of Experience for JavaScript, web and Microsoft technologies. ASP.NET MVC,Web Forms,C#,AngularJs,Golang
Mvp profile
Subscribe to my blog

Enter your email address:

Follow us on facebook
Blog Archive
Total Pageviews