Click here to Skip to main content
15,897,704 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am setting the passwordStrengthRegularExpression attribute in we.config but it is showing the errors as following what is the problem here?

HTML
passwordStrengthRegularExpression=" @"(?=.{6,})(?=(.*d){1,})(?=(.*W){1,})" 



The character '.', hexadecimal value is illegal at the beginning of an XML name.
The character '{', hexadecimal value is illegal at the beginning of an XML name.
The character '6', hexadecimal value is illegal at the beginning of an XML name.
The character '}', hexadecimal value is illegal at the beginning of an XML name.

.
.
.
.
.
So many errors are coming how can i set the value for this attribute.....
Posted
Comments
Christian Amado 9-Aug-12 9:07am    
What the regularexpression intent to validate?
Srinubabu Ravilla 9-Aug-12 9:13am    
Validating the password in asp.net member creation
Christian Amado 9-Aug-12 9:16am    
passwordStrengthRegularExpression="@(?=.{6,})(?=(.*d){1,})(?=(.*W){1,})"
Srinubabu Ravilla 11-Aug-12 1:13am    
Thank you Christian Amado.
It is working fine.......

This is working fine....

C#
passwordStrengthRegularExpression="@(?=.{6,})(?=(.*d){1,})(?=(.*W){1,})"
 
Share this answer
 
Hi,
Try this:
HTML
<membership defaultProvider="SqlProvider"
  userIsOnlineTimeWindow = "20">
  <providers>
    <add
      name="SqlProvider"
      type="System.Web.Security.SqlMembershipProvider"
      connectionStringName="SqlServices"
      requiresQuestionAndAnswer="true"
      passwordStrengthRegularExpression=" @\"(?=.{6,})(?=(.*\d){1,})(?=(.*\W){1,})"
      />
   </providers>
</membership>

You are missing a "\".


--Amit
 
Share this answer
 
v2
Let me try my answer as solution.

The problem was the quote after @.
HTML
passwordStrengthRegularExpression="@(?=.{6,})(?=(.*d){1,})(?=(.*W){1,})"


Regards

-----
Please, mark as solution if you find useful as you said in the comments to help another developers =)
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900