ASP.net Membership Provider Setup

In order to set up your application to use Microsoft’s ASP.net Membership Provider you need to do the following.

1. Set up your database by installing the Membership schema. This is done by locating the aspnet_regsql.exe utility found in the C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 directory. Run it using the -W flag (aspnet_regsql -W) and walk through the wizard that you are presented with.

2. Add a connection string to your web.config which points to the database you just installed the Memberhsip schema in.



<add name="LocalSqlServer"
connectionString="server=THESQLSERVER;uid=DATABASEUSERID;pwd=DATABASEPASSWORD;database=DATABASENAME"
providerName="System.Data.SqlClient" />

3. Then you need to add the membership provider to the web.config as follows




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

4. Thats it, your done!

Published by

Tim Clark

Experienced Business Owner, Chief Information Officer, Vice President, Chief Software Architect, Application Architect, Project Manager, Software Developer, Senior Web Developer, Graphic Designer & 3D Modeler, University Instructor, University Program Chair, Academic Director. Specialties: Ruby, Ruby on Rails, JavaScript, JQuery, AJAX, Node.js, React.js, Angular.js, MySQL, PostgreSQL, MongoDB, SQL Server, Responsive Design, HTML5, XHTML, CSS3, C#, ASP.net, Project Management, System Design/Architecture, Web Design, Web Development, Adobe CS6 (Photoshop, Illustrator)

One thought on “ASP.net Membership Provider Setup

  1. Nice and concise 😉 I've slogged through some of the tutorials on Asp.net and you have captured the essential. A good time saver!

    Like

Leave a comment