script :
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:CompareValidator ID="CompareValidator1" runat="server"
ErrorMessage="Start date must be smaller than End date "
ControlToCompare="txtStartDate"
ControlToValidate="txtEndDate"
Type="Date"
ForeColor="Red"
Operator="GreaterThanEqual"
Display="Dynamic" >
</asp:CompareValidator>
<asp:TextBox ID="txtStartDate" runat="server" MaxLength="25" Width="150px"
Height="18px"></asp:TextBox>
<asp:ImageButton ID="imgcalendarStart" runat="server"
AlternateText="Click to show calendar"
ImageUrl="~/images/Calendar_scheduleHS.png" CausesValidation="False" />
<asp:Label ID="Label1" runat="server" Text="(dd/mm/yyyy)" ForeColor="Red"></asp:Label>
<asp:MaskedEditExtender ID="txtStartDate_MaskedEditExtender" runat="server"
Mask="99/99/9999"
MessageValidatorTip="true"
OnFocusCssClass="MaskedEditFocus"
OnInvalidCssClass="MaskedEditError"
MaskType="Date"
ErrorTooltipEnabled="True"
TargetControlID="txtStartDate"
CultureName="en-GB"
>
</asp:MaskedEditExtender>
<asp:MaskedEditValidator ID="MaskedEditValidator2" runat="server"
ControlExtender="txtStartDate_MaskedEditExtender"
ControlToValidate="txtStartDate"
EmptyValueMessage="Date is required"
InvalidValueMessage="Date is invalid"
Display="Dynamic"
TooltipMessage="Input a date"
EmptyValueBlurredText="*"
InvalidValueBlurredMessage="*"
ForeColor="Red"
/>
<asp:CalendarExtender ID="calendarButton1Extender" runat="server"
Enabled="True" TargetControlID="txtStartDate"
PopupButtonID="imgcalendarStart" Format="dd/MM/yyyy">
</asp:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvStartDate" runat="server" ErrorMessage="*"
ControlToValidate="txtStartDate" ForeColor="Red"></asp:RequiredFieldValidator>
<asp:TextBox ID="txtEndDate" runat="server" MaxLength="25" Width="150px"
Height="18px"></asp:TextBox>
<asp:ImageButton ID="imgCalenderEnd" runat="server"
AlternateText="Click to show calendar"
ImageUrl="~/images/Calendar_scheduleHS.png" CausesValidation="False" />
<asp:Label ID="Label7" runat="server" Text="(dd/mm/yyyy)" ForeColor="Red"></asp:Label>
<asp:MaskedEditExtender ID="txtEndDate_MaskedEditExtender" runat="server"
Mask="99/99/9999"
MessageValidatorTip="true"
OnFocusCssClass="MaskedEditFocus"
OnInvalidCssClass="MaskedEditError"
MaskType="Date"
ErrorTooltipEnabled="True"
TargetControlID="txtEndDate"
CultureName="en-GB"
>
</asp:MaskedEditExtender>
<asp:MaskedEditValidator ID="MaskedEditValidator1" runat="server"
ControlExtender="txtEndDate_MaskedEditExtender"
ControlToValidate="txtEndDate"
EmptyValueMessage="Date is required"
InvalidValueMessage="Date is invalid"
Display="Dynamic"
TooltipMessage="Input a date"
EmptyValueBlurredText="*"
InvalidValueBlurredMessage="*"
ForeColor="Red"
/>
<asp:CalendarExtender ID="calendarButton2Extender" runat="server"
Enabled="True"
TargetControlID="txtEndDate"
PopupButtonID="imgCalenderEnd"
Format="dd/MM/yyyy"
>
</asp:CalendarExtender>
<asp:RequiredFieldValidator ID="rfvEndDate" runat="server"
ControlToValidate="txtEndDate" ErrorMessage="*" ForeColor="Red">
</asp:RequiredFieldValidator>
No comments:
Post a Comment