[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

RegularExpressionValidator

Posted on 2011-09-07
2
Medium Priority
?
244 Views
Last Modified: 2012-05-12
Hey guys, i have an RegularExpressionValidator and i want to allow the user to enter specail char,

like ritesh's

it does not work, i want to allow the user to enter  '   @ $!  


here my code

 <asp:RegularExpressionValidator ID="RFVF_CName" runat="server" ControlToValidate="txtRName"
                    CssClass="validator" ErrorMessage=" 4-50 char required!" ValidationExpression="^[0-9a-zA-Z ]{4,50}$"
                    ValidationGroup="a" />
0
Comment
Question by:JCWEBHOST
  • 2
2 Comments
 
LVL 3

Accepted Solution

by:
PrisonBroken earned 2000 total points
ID: 36495493
try

ValidationExpression="^[0-9a-zA-Z !@'\$]{4,50}$"

or

ValidationExpression="^[0-9a-zA-Z\s!@'\$]{4,50}$"
0
 
LVL 3

Expert Comment

by:PrisonBroken
ID: 36495515
all you should need do is add a \ before any special characters.

Cheers

0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month18 days, 16 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question