I have applied RangeValidator
on TextBox
. But it always shows me error : Invalid Range, though I have given minimum value 10 and maximum value 25. I want that user must not enter value whose length is less than 10 and greater than 25. I want that user can enter anything, so I have type="string"
in RangeValidator
. But it always gives me error message : Invalid Range.
<td>
<asp:TextBox ID="tbPassword" runat="server" MaxLength="25" type="password">
</asp:TextBox>
<asp:RequiredFieldValidator ID="rfvPassword" runat="server"
ControlToValidate="tbPassword" ForeColor="red" Display="Dynamic"
ErrorMessage="Password is required." SetFocusOnError="true">
</asp:RequiredFieldValidator>
<asp:RangeValidator ID="rvPassword" ControlToValidate="tbPassword"
ForeColor="red" Display="Dynamic" MinimumValue="10" MaximumValue="25"
SetFocusOnError="true" Type="String" runat="server"
ErrorMessage="Invalid Range">
</asp:RangeValidator>
</td>