This is the code that I am using but when I run that code it display an error message even if I put value within range.please Can anyone help me with this?
<tr>
<td class="auto-style4">Password</td>
<td class="auto-style3">
<asp:TextBox ID="Pass" runat="server"></asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ControlToValidate="Pass" ErrorMessage="Please enter Password" ForeColor="Red"></asp:RequiredFieldValidator>
<br />
<asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="Pass" Display="Dynamic" ErrorMessage="Password range (1 -10)" ForeColor="Red" MaximumValue="10" MinimumValue="1"></asp:RangeValidator>
</td>
</tr>
with this
RangeValidatoryou are declaring thattextboxvalue should be within1 to 10that means if you input11or0or anyintegerwhich is not between1 to 10it will showErrorMessage. I think you want to check thetextboxlength between1 to 10then you need aRegularExpressionValidatorlike below