?
Solved

RegularExpressionValidator

Posted on 2011-09-07
2
Medium Priority
?
240 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 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
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.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

777 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