Reputation:
We have written as below lines of code
<div class="controls">
<asp:TextBox ID="txtPort" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator CausesValidation="true" ID="rfvprot" runat="server" ErrorMessage="Enter port number." ControlToValidate ="txtPort">*</asp:RequiredFieldValidator>
<asp:RangeValidator CausesValidation="true" ID="RVPort" runat="server" ErrorMessage="Enter value between 1 to 65000" ControlToValidate ="txtPort" MinimumValue ="1" MaximumValue ="65000"></asp:RangeValidator>
</div>
If we enter value 667 or any value, then click on submit button, it still displays the validation message.
Upvotes: 1
Views: 908
Reputation: 8818
You can try and add a type to the RangeValidator
<asp:RangeValidator Type="Double" OR
<asp:RangeValidator Type="Integer"
Upvotes: 0