I'm relatively new to C# and ASP.NET (came from the PERL (CGI) world).
I am looking at a string the user is going to enter in a text box, and want to determine whether or not it could be a name.
A
name doesn't have any numbers in it, and the entire string should
contain at least 2 spaces and at most 3 spaces (first middle last).
I have attempted using required field validators and custom validators, for SOME of the code (Credit
Card Number, etc.), but oddly enough the custom validators are bypassed
when the "Submit" button is clicked (with PostBackUrl pointing to the
next page). So I've decided to write my own validators, and if all
passes then write the data into SQL, and follow up with a "thank you"
page using Response.Redirect.
Since
this is a common problem, I am supposing that there is a common
solution.
My question is, what is the common solution to this common problem? (scanning the string to see if it's a name)
TIA
Loading
Ken BarrettPosted Feb 13, 2009, 2:30 PM
So thanks to all anyway!
Bechir BejaouiPosted Feb 14, 2009, 4:59 AM
http://msdn.microsoft.com/en-us/library/system.text.regularexpressions(VS.71).aspx
I advise that you give him this link. In deed, I'm giving leçons about .Net framework on line noadays to an engeenier who comes from other language world, if you want you can join us.
Ken BarrettPosted Feb 13, 2009, 8:47 PM
I took a C# class at the local college last fall, and complained to the prof. about the lack of regular expressions.. I came from a unix world, learned C-shell, then C, then C++, then PERL... and believe regular expressions make thing so much easier..
Regardless of this, when I complained about missing Regular Expressions in C#, he said that they were indeed NOT in the language... so much for the quality of professors out there.
Thanks again!!
Ken
Bechir BejaouiPosted Feb 13, 2009, 6:32 PM
http://www.c-sharpcorner.com/UploadFile/Kolonist/regularexpressions07042006083534AM/regularexpressions.aspx