Regular Expression Validator to validate numeric range in ASP.Net

on Dec 01, 2019 11:26 PM

what will be the validation expression in regular expression validator for range between 30 to 360 and the range between 20 to 240?

Download FREE API for Word, Excel and PDF in ASP.Net: Download
on Dec 02, 2019 04:33 AM

Hi nid@patel,

Instead of using RegularExpressionValidator use RangeValidator.

Check the example.

<asp:TextBox runat="server" ID="txtNumber" />
<asp:RangeValidator ErrorMessage="Range must be between 30 and 360" ControlToValidate="txtNumber" runat="server"
    MaximumValue="360" MinimumValue="30" />