hi
I have 2 Date Texboxes and To-Date must be greater than from-date.
And Also dateDifference of From and ToDate must be Equat to Number ofDays.
I am very confusing to giving the validation for DateDifference of from and to date = NoDays.
Can anyone Help me this.
This is my code
Suppose txtNoDays=2 and DateDiff("d",txtFromDate,txtToDate)=3 then the error message shold display.Code:<asp:TextBox id="txtNoDays" runat="server" size="12"></asp:TextBox> <Asp:Textbox id="txtFromDate" runat="server" size="12"></Asp:Textbox> <asp:CompareValidator id="StartVal" runat="server" ErrorMessage="?" ControlToValidate="txtFromDate" Operator="DataTypeCheck" Type="Date"></asp:CompareValidator> <asp:TextBox id="txtToDate" runat="server" size="12"></asp:TextBox> <asp:CompareValidator id="DiffVal" runat="server" ErrorMessage="?" ControlToValidate="txtToDate" Operator="GreaterThan" Type="Date" ControlToCompare="txtFromDate"></asp:CompareValidator>
thanks


Reply With Quote