Range Validator showing error message but not preventing submit button click

236 Views Asked by At

This is my html code. I wonder why this range validator is not preventing the submit button click. any help will really be appreciated.

<asp:TextBox runat="server" class="form-control"  
     ID="AGE" ReadOnly="false" required="true"  />

<asp:RangeValidator ID="RVAGE" runat="server" MinimumValue="1" 
     MaximumValue="110" ErrorMessage="Range 1-110 "
     ControlToValidate="AGE" Display="Dynamic"> 
</asp:RangeValidator>

<asp:Button  OnClientClick="return CheckDouble();"  
     CausesValidation="true" OnClick="submitclick" 
     ID="submitbtn" runat="server" Text="Submit" >
</asp:Button>
                                  
0

There are 0 best solutions below