Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

How To Apply numeric digit Limit in Regular Expression in with C# Asp.Net

$
0
0

Hello All,

I have a TextBox. In this TextBox  I need that I should be able to enter only numeric value (with decimal OR with out Decimal).

If Decimal is there then maximum limit 5 before decimal Point and 5 After Decimal Point. and Decimal should be only 1 time not more than 1 Time.

If decimal point is not there then only 5 digit. For that I wrote 1 Regular Expression But its nt working... What should i change in this to achieve Requirment...

<asp:TextBox ID="txtCommision" runat="server" ></asp:TextBox>

<asp:RegularExpressionValidator ID="revCommision"
runat="server"
ErrorMessage="Numeric value"
ControlToValidate="txtCommision"
ValidationExpression="^[\d]{1,5}([.]{1}[\d]{1,5})?$">
</asp:RegularExpressionValidator>

Thanks in Advance.


Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>