How to solve Password length minimum 7 Non alphanumeric characters required 1

 

Introduction

In this article I will explain how to solve Password length minimum: 7. Non-alphanumeric characters required: 1 and how to remove password restrictions, unique email requirement and question and answer options during user registration in Membership using asp.net.

To create user in database we need to enter password like pass#123 then it will accept otherwise it will throw error like length minimum: 7. Non-alphanumeric characters required: 1 what if you got requirement like register user without strong password restrictions and no need to enter unique email and without Question and answer options at that time I tried to remove problem by setting some properties in web.config. Follow below steps to change our application to work according our requirements.

History

In the Previous articles i explained how to upload image to the server or application using Ckeditor , how to change or set width of ckeditor textbox area using asp.netintegrate custom image uploader control with ckeditor using asp.nethow to add asp.net membership tables to the existing databasehow to get connection string from web .config file, how to create dynamic xml sitemap in asp.net  and many more about Asp.Net.

Step 1.

Create a new web application and name it as"Demo_application".

Step 2.

Drag and drop createuserwizard control from toolbox to the default.aspx page.

Step 3.

Now open Web.config file and write the following code

First write the connection string in <configuration> tab.

<connectionStrings>
    <add name="database_con" connectionString="Data Source=MY-PC\SQLEXPRESS;Initial Catalog=DB1;Integrated Security=True" providerName="System.Data.SqlClient"/>
  </connectionStrings>

After that write the following code in system.web section.

<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="Connection" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" applicationName="SampleApplication"/>
</providers>
</membership>
<profile>
<providers>
<clear/>
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="Connection" applicationName="SampleApplication"/>
</providers>
</profile>
<roleManager enabled="false">
<providers>
<clear/>
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="Connection" applicationName="SampleApplication"/>
</providers>
</roleManager>

Here I will explain each option whatever I set in web.config to remove restrictions :

requiresQuestionAndAnswer="false"
By using this property we can remove Question and answer options in CreateUserWizard.

requiresUniqueEmail="false"
By setting this property no need to enter unique email id we can use same email id for number of accounts.

minRequiredPasswordLength="6"
By setting this property user need to enter at least 6 characters for password.

minRequiredNonalphanumericCharacters="0"
By setting this property no need to enter any special characters for password.

After that run your application and create user by using CreateUserWizard now it doesn’t show any Question and Answer options and it will accept 6 characters password it won’t show any problem like Password length minimum: 7. Non-alphanumeric characters required: 1.

Give your Valuable Comments.
comments powered by Disqus
 
Follow me on twitter
About Me
Harpreet Singh
I began programming with C++ when i was 17. Then at the middle of my study .NET came. Then I began to read C# and VB.NET. By the time i learnt SQL and ASP.NET, and developed some websites such as news portals that are active now. Currently i am running my own Software company.
More Articles