Click here to Skip to main content
15,906,567 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
i am using regular expression validator to check Country code number. country code should be 2 to 3 digit. below expression is working but it will take space and empty text box. i dont want any space or empty textbox. i want changes in this expresssion to not allow space and i dont want to use required required field validator.

XML
<asp:RegularExpressionValidator ValidationExpression="(Country Code)|^[0-9]{2,3}$" ID="revCountryCode"runat="server" ControlToValidate="txtCountryCode" ValidationGroup="Register" ErrorMessage=" Enter Valid Country Code" SetFocusOnError="true" ForeColor="Red"></asp:RegularExpressionValidator>




thanks
manohar
Posted
Comments
ArunRajendra 27-Sep-13 6:50am    
Just a guess can you try by removing $?
Manohar Khillare 27-Sep-13 6:55am    
YES I TRY BUT ITS NOT WORKING

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900