Aspdotnet-Suresh

aspdotnet-suresh offers C#.net articles and tutorials,csharp dot net,asp.net articles and tutorials,VB.NET Articles,Gridview articles,code examples of asp.net 2.0 /3.5,AJAX,SQL Server Articles,examples of .net technologies

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.

Jan 23, 2011
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.

Description:

In my previous article I explained clearly how to use Custom database for Membership and how to create user with custom database


To create user in database we need to enter password like abcd@123 then it will accept otherwise it will throw error like length minimum: 7. Non-alphanumeric characters required: 1 but I 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.

Create one new web application and name it as Registration.aspx now drag and drop the one new control CreateUserWizard from Login Controls list that aspx page like this

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:CreateUserWizard ID="CreateUserWizard1" runat="server">
<WizardSteps>
<asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">
</asp:CreateUserWizardStep>
<asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">
</asp:CompleteWizardStep>
</WizardSteps>
</asp:CreateUserWizard>
</div>
</form>
</body>
</html>
Now open Web.config file and write the following code
Write the connectionstring like this
<connectionStrings>
<add name="Connection" connectionString="Data Source=SureshDasari;Integrated Security=true;Initial Catalog=AspMembership" 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.

Demo


If you enjoyed this post, please support the blog below. It's FREE!

Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email.

subscribe by rss Subscribe by RSS subscribe by email Subscribe by Email

4 comments :

Anonymous said...

Hi.

I understand everything else than the system web section. I now that the system web is in the reference folder, but where should i put in the code.

regards.
Ivan.

manoj said...

pls explain coding concepts

Anonymous said...

code for forgot password in .net
how to send gridview in email
how to send grid view in email body in asp
genrate create thumbnail from your mail
how to insert image in data base
introduction to object oriented programing
simpal login form examle to edit grid view row valuw in asp .net ajax cascading drop down list simpal withdata base using asp .net asp .net insert edit update delete data in grid view ajax model pop up extender exampal to simpal log in form exampal how to send grid view code for forgot password edit update bdelete data

Unknown said...

Dear I have used your prescribed code regarding that error in web.config file inside account folder but still facing the same error. except changing the application

applicationName="UsingMembership" Name of my application

please tell me how to fix it

Give your Valuable Comments

Note: Only a member of this blog may post a comment.

© 2015 Aspdotnet-Suresh.com. All Rights Reserved.
The content is copyrighted to Suresh Dasari and may not be reproduced on other websites without permission from the owner.