In web application, i am try to validate the date by using compare validator. but it is throwing error, This is my code
<asp:CompareValidator
ID="CompareValidator1"
runat="server"
Text="*"
Display="None"
ValidationGroup ="a"
ControlToValidate="txtValidate"
ValueToCompare='<%# DateTime.Today.ToShortDateString() %>'
Operator="GreaterThan"
Type ="Date"
ErrorMessage="Date Should Greater Than Todate">
</asp:CompareValidator>
The error is :
The value ” of the ValueToCompare property of ‘CompareValidator1’
cannot be converted to type ‘Date’.
In your
Page_Loadmethod, callPage.DataBind().This will execute the databinder code when the page is loaded.