You must Sign In to post a response.
  • Category: ASP.NET

    Validation Expression like 1.00 (one integer-decimal-two integer only)

    Hello Developers ,

    i want to validate a text box like 1.00 (only one integer-decimal-two integer only).
    if user enter
    22.22-incorrect
    .22-incorrect
    222.2-incorrect
    2.222-incorrect

    1.22-Correct

    i have tried lot of time but i can't able to get exact output.So anyone please help me to i am done this validation

    Thanking you .
    Paul.S
  • #763373
    Please try this.

    <code>
    <asp:TextBox ID="TextBox2" runat="server" />
    <br />
    <asp:RegularExpressionValidator ID="Regex2" runat="server" ValidationExpression="((\d+)+(\.\d+))$"
    ErrorMessage="Invalid data" ControlToValidate="TextBox2" />
    </code>


Sign In to post your comments