I have a ascx file in which i have placed the below code:
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:TextBox ID="textboxDate" runat="server" CssClass="FieldValue" MaxLength="10"
Columns="12" autocomplete="off" Style="padding-right: 18px; border: 1px solid #567890;" />
<ajaxToolkit:CalendarExtender ID="calendarExtenderDate" runat="server" TargetControlID="textboxDate"
PopupButtonID="textboxDate" />
<asp:RequiredFieldValidator runat="server" Enabled="false" ControlToValidate="textboxDate"
ID="valRequired" ErrorMessage="* This field is required" EnableClientScript="true"
Display="Dynamic" Text="*" />
<asp:CompareValidator runat="server" CssClass="error" ControlToValidate="textboxDate"
Operator="DataTypeCheck" Display="Dynamic" Type="Date" ID="valValidDate" ErrorMessage="* Date is in an incorrect format"
Text="*" EnableClientScript="true" />
<asp:CustomValidator CssClass="error" Text="*" runat="server" ID="rangeVal" Display="dynamic" OnServerValidate="rangeVal_Validate" />
I’m calling this user control in one of my form by
<uc:DateControl ID="dateControlStart" runat="server" RequiredErrorMessage="please enter date" />
So , i want if user select any date which is less than or equal to current date an error should come saying “incorrect error”. I want to do this validation in the aspx page on client side not in user control. Can any one help me?
}
CustomValidator have to insert in your page together with your uc:DateControl