//
you're reading...
Asp.net

Password without non-alphanumeric characters

To create a password without non-alphanumeric characters in asp.net add following code into web.config file.

<membership>

<providers>

<remove name=”AspNetSqlMembershipProvider” />

<add name=”AspNetSqlMembershipProvider”

type=”System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a”

connectionStringName=”AspNetDBConnection”

enablePasswordRetrieval=”false”

enablePasswordReset=”true”

requiresQuestionAndAnswer=”true”

applicationName=”/”

requiresUniqueEmail=”false”

minRequiredPasswordLength=”1″

minRequiredNonalphanumericCharacters=”0″

passwordFormat=”Hashed”

maxInvalidPasswordAttempts=”5″

passwordAttemptWindow=”10″

passwordStrengthRegularExpression=”" />

</providers>

</membership>

Here,

connectionStringName=”LocalSqlServer” – name of your ConnectionString (you’ll probably have to replace this one with your – you’ll find your in web.config file too. ConnectionString look like this (name of this one is Aspnetdb):
<add connectionString=”Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True”
providerName=”System.Data.SqlClient” />
enablePasswordRetrieval=”false” – users won’t be able to recieve their password from database
enablePasswordReset=”true” – users will be able to reset his password
requiresQuestionAndAnswer=”true” – users will have to specify their Security Question/Answer
applicationName=”/” – name of your application
requiresUniqueEmail=”false” – each user doesn’t have to have unique e-mail
minRequiredPasswordLength=”1″ – minimal lenght of password
minRequiredNonalphanumericCharacters=”0″ – minimal non-alphanumeric characters in password passwordFormat=”Hashed” – format of the password in which will be saved in database
maxInvalidPasswordAttempts=”5″ – Specifies the number of allowed password or password answer attempts that are not valid

Advertisement

About Anupam

Software Developer @KDS Group

Discussion

One Response to “Password without non-alphanumeric characters”

  1. I went over this internet site and I think you have a lot of superb info , saved to bookmarks (:.

    Posted by find used mazda | February 24, 2011, 5:37 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Archives

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1 other follower

Follow

Get every new post delivered to your Inbox.