How to allow only numeric or float value in textbox in asp.net using c#

Posted by Unknown On Friday, 4 October 2013 0 comments

Hi, In this post I mentioned that how to allow insert only numeric or float value in textbox. For doing this you have to just put the compare validate control and set the property and you work is done.

First take one text box and then take compartmentalize and set its property as follow.

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

<asp:CompareValidator ID="Cmp1" runat="server" ErrorMessage="Enter Valid Quantity" Type="Double" Operator="DataTypeCheck" ControlToValidate="txtbx_issuedqty1" ForeColor="Red" ValidationGroup="add">*</asp:CompareValidator>

Hope it will help you.

0 comments:

Post a Comment