HighTechTalks DotNet Forums  

ASP.NET validation problem

Dotnet Scripting microsoft.public.dotnet.scripting


Discuss ASP.NET validation problem in the Dotnet Scripting forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
TJ Hatch
 
Posts: n/a

Default ASP.NET validation problem - 04-30-2006 , 11:52 AM






I am coding with Visual studio 2003 using .NET 1.1
I hope this is an appropriate group for this question. I am new to .NET and
have been given a project where I need to validate and confirm a password. I
understand that \w will match any word so long as it does not contain
whitespace.I have also foud out that \w=[a-zA-Z_0-9]. In my project I use a
reg ex validator to validate the password as all lower caps and a compare
validator to compare the confirm against the password. Unfotuneately, I am
not sure how to express all lower caps so I always get a validation errorfrom
the regex val. I have the compare validator working and returning an error
when it doesn't match the password.
For the reg ex validator I tried: [^a-z$] --:but it didn't work.
Isn't [^a-z$] looking for a string from a to z?
Then I simplifiled the expression to [^a-z] with no change in the outcome.
Now I have it as [a-z] and it still says the error message every time.
If I include a requiredfield validator for the username the compare
validator doesn't work even when I enter a user name
Please help if you can.



Reply With Quote
  #2  
Old   
Peter Torr \(MS\)
 
Posts: n/a

Default Re: ASP.NET validation problem - 05-02-2006 , 11:52 AM






"TJ Hatch" <TJHatch (AT) discussions (DOT) microsoft.com> wrote

Quote:
I am coding with Visual studio 2003 using .NET 1.1
I hope this is an appropriate group for this question. I am new to .NET
and
have been given a project where I need to validate and confirm a password.
I
understand that \w will match any word so long as it does not contain
whitespace.I have also foud out that \w=[a-zA-Z_0-9]. In my project I use
a
reg ex validator to validate the password as all lower caps and a compare
validator to compare the confirm against the password. Unfotuneately, I am
not sure how to express all lower caps so I always get a validation
errorfrom
the regex val.
Hi,

It is generally a bad idea to RESTRICT the values of a password, but I will
assume you have good reason for doing so (eg, integration with a REALLY OLD
backend system).

Having said that, you should just use:

^[a-z]+$

^ = Start of string
[a-z] = Any letter
+ = One or more times
$ = End of string

Peter

--
Peter Torr - http://blogs.msdn.com/ptorr
HD DVD Program Manager




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.