Click here to Skip to main content
15,900,907 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
I want validations accept only numbers and only one decimal using any asp.net validation controls only.
Posted
Comments
abbaspirmoradi 27-Aug-13 6:34am    
Do you want user only can input numbers and only one decimal point into your controls?
Thanks7872 27-Aug-13 6:37am    
That is what written in question it self by OP.accept only numbers and only one decimal

 
Share this answer
 
v2
Comments
Thanks7872 27-Aug-13 6:37am    
Looks promising. Upvoted..! :)
Anuja Pawar Indore 27-Aug-13 6:51am    
Thanks Rohan
Try a Regular expression validator with the below expression

ASP.NET
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" ControlToValidate="TextBox1"
       ValidationExpression="^\d+(\.\d{1,1})?$" runat="server" ErrorMessage="RegularExpressionValidator"></asp:RegularExpressionValidator>
 
Share this answer
 
v2

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