473,413 Members | 2,044 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

ValidationExpression Error

I am currently using the ChangePassword control for ASP.NET 2.0 to
allow users to update or change their password as need be. However I am
running into a problem with the Regular Expression Validation. I have
tried the following code:

ValidationExpression="[\w]{5,}"

ValidationExpression="[\w|\d]{5,}"

ValidationExpression="^[\w]{5,}$"

ValidationExpression="^[\w|\d]{5,}$"

ValidationExpression="\w{5,}"

But each time the validation check ends. I am entering a password that
is 9 characters long to test so I know it's not a length issue. So what
exactly am I missing as from my research on the subject one of those
above expressions should work for validating that the field is 5
characters or more.

-Steve

Nov 17 '06 #1
3 4556
Hey Steve,

Try this one

^\w{5,}$
--
Bits. Bytes.
http://bytes.thinkersroom.com
------------------------------
"sk******@gmail.com" wrote:
I am currently using the ChangePassword control for ASP.NET 2.0 to
allow users to update or change their password as need be. However I am
running into a problem with the Regular Expression Validation. I have
tried the following code:

ValidationExpression="[\w]{5,}"

ValidationExpression="[\w|\d]{5,}"

ValidationExpression="^[\w]{5,}$"

ValidationExpression="^[\w|\d]{5,}$"

ValidationExpression="\w{5,}"

But each time the validation check ends. I am entering a password that
is 9 characters long to test so I know it's not a length issue. So what
exactly am I missing as from my research on the subject one of those
above expressions should work for validating that the field is 5
characters or more.

-Steve

Nov 17 '06 #2
Rad,

Tried that one but it still errors out on me.

<asp:RegularExpressionValidator ID="valPasswordLength" runat="server"
ControlToValidate="NewPassword" SetFocusOnError="true"
Display="Dynamic" ValidationExpression="^\w{5,}$" ErrorMessage="New
Password must be at least 5 characters long." ToolTip="New Password
must be at least 5 characters long."
ValidationGroup="ChangePassword1">*
</asp:RegularExpressionValidator>

That is the Validator element of the asp:Changepassword control that I
am using. Maybe something else in there is wrong but I just don't see
what the problem is.

Rad wrote:
Hey Steve,

Try this one

^\w{5,}$
--
Bits. Bytes.
http://bytes.thinkersroom.com
------------------------------
"sk******@gmail.com" wrote:
I am currently using the ChangePassword control for ASP.NET 2.0 to
allow users to update or change their password as need be. However I am
running into a problem with the Regular Expression Validation. I have
tried the following code:

ValidationExpression="[\w]{5,}"

ValidationExpression="[\w|\d]{5,}"

ValidationExpression="^[\w]{5,}$"

ValidationExpression="^[\w|\d]{5,}$"

ValidationExpression="\w{5,}"

But each time the validation check ends. I am entering a password that
is 9 characters long to test so I know it's not a length issue. So what
exactly am I missing as from my research on the subject one of those
above expressions should work for validating that the field is 5
characters or more.

-Steve
Nov 17 '06 #3
Hey Steve,

If I understand you correctly you have a ChangePassword control on
your form, and you want to validate the new password such that it is
at least 5 characters.

I've recreated the scenario on my PC. What you want to do is put the
regular expression ,^\w{5,}$, in the property
NewPasswordRegularExpression.

If you view source at this point your control's source should be as
follows:

<asp:ChangePassword ID="ChangePassword1" runat="server"
NewPasswordRegularExpression='^\w{5,}$'>
</asp:ChangePassword>

Try that out and let me know if it works. I've been able to test it on
my PC and it works like poetry

On 17 Nov 2006 08:23:58 -0800, sk******@gmail.com wrote:
>Rad,

Tried that one but it still errors out on me.

<asp:RegularExpressionValidator ID="valPasswordLength" runat="server"
ControlToValidate="NewPassword" SetFocusOnError="true"
Display="Dynamic" ValidationExpression="^\w{5,}$" ErrorMessage="New
Password must be at least 5 characters long." ToolTip="New Password
must be at least 5 characters long."
ValidationGroup="ChangePassword1">*
</asp:RegularExpressionValidator>

That is the Validator element of the asp:Changepassword control that I
am using. Maybe something else in there is wrong but I just don't see
what the problem is.
--

Bits.Bytes.
http://bytes.thinkersroom.com
Nov 17 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: JIM.H. | last post by:
ValidationExpression="\d{2}/\d{2}/\d{4}" how can you make this work for date exactly. Taking care of Feb for example?
1
by: CoreyMas | last post by:
Hello Everyone I am in search of a ValidationExpression that will detect if a user has entered Script or HTML code inside of a textbox. Or in the very least look for an expression that detects...
0
by: Andy Eshtry | last post by:
I have a radio button list, a textbox representing SIN or EIN based on my radio button list selection so I put 2 regularexpressionvalidator to evaluate the value of textbox. EIN must be (for...
3
by: TD | last post by:
Is it possible to validate (or in this case, invalidate) an exact number with a RegularExpressionValidator? I know that it can be done with javascript but what about regular expressions? Any...
2
by: Nathan Sokalski | last post by:
As we probably know, the MaxLength property of the TextBox control only works when the TextMode property is SingleLine or Password. I want to limit the number of characters a user can enter into a...
0
by: Morten71 | last post by:
I have this regex. in the ValidationExpression property of my dotnet 1.1 RegularExpressionValidator control: ^(?i)(DF)?+$ However, I can't make the ignore case part (?i) work! How should I...
3
by: lukkynivas | last post by:
Hi, this is CNU ,can any body let me know what is the validationexpression for following criteria my text should contain At least one digit,6 to 12 chars and underscore i gave like (\w*+\w*) but...
5
by: Matt Nunnally | last post by:
I'm trying to get my zip code textbox to validate both US zip codes and Canadian Postal code formats. But I can't figure out the syntax. Can somebody help? Here is what I got: ...
1
by: J055 | last post by:
Hi I've having trouble getting this expression to work in both javascript and server side. (?:^.+\.)(?i-msnx:((jpg)|(gif)))$ I'd like to apply a ValidationExpression which is case...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.