Solved

RegularExpressionValidator

Posted on 2011-09-07
2
234 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 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This video discusses moving either the default database or any database to a new volume.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

706 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now