Solved

RegularExpressionValidator

Posted on 2011-09-07
2
238 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 3

Accepted Solution

by:
PrisonBroken earned 500 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

733 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