Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

datePicker.ascx
<asp:TextBox ID="txtDatePicker" runat="server"></asp:TextBox> 
    <asp:ImageButton runat="Server" ID="Image1" ImageUrl="~/Images/calendar.png" AlternateText="Click to show calendar" /> 
    <ajaxToolkit:CalendarExtender Format="dd/MM/yyyy" ID="CalendarExtender1" TargetControlID="txtDatePicker" runat="server" PopupButtonID="Image1" />

register.aspx
<%@ Register Src="~/Modules/datePicker.ascx" TagName ="datePicker" TagPrefix ="uc1"  %>

Start Date   <uc1:datePicker ID="datePickerSD" runat="server" >
End Date     <uc1:datePicker ID="datePickerED" runat="server" />
 <asp:CustomValidator  ID="CustomValidator1"  ControlToValidate="datePickerED"
                      ErrorMessage="End date should be greater than start date" runat="server" />
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
160 views
Welcome To Ask or Share your Answers For Others

1 Answer

<asp:CompareValidator ID="cmpr" runat="server" ControlToCompare ="txtDate1" ControlToValidate="txtDate2" Operator="GreaterThan" Type="Date" ErrorMessage="To date should great than small data"></asp:CompareValidator>

Have you tried compare validator ? This can help you


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...