<div>
<ajaxToolkit:NumericUpDownExtender runat="server" Maximum="10" Minimum="1" TargetControlID="txtNumberOfAwards" Width="200" />
<asp:TextBox ID="txtNumberOfAwards" runat="server" CssClass="form-control" MaxLength="2" Text="0"></asp:TextBox>
<asp:RangeValidator runat="server" ControlToValidate="txtNumberOfAwards" ErrorMessage="Enter number between 0 to 10" Type="Integer" MinimumValue="0" MaximumValue="10" ForeColor="Red" ValidationGroup="transfer_request" SetFocusOnError="true"></asp:RangeValidator>
</div>
aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
txtNumberOfAwards.MaxLength = 2;
}
}
No comments:
Post a Comment