T
Tamer Ibrahim
Hi,
I'm trying to validate user input date using range validator on a text box .
This code is throwing this exception
"The value 'DateTime.Now;' of the MaximumValue property of 'rvQDate' cannot
be converted to type 'Date'. "
<asp:TextBox ID="txtQDate" runat="server" Enabled="False"></asp:TextBox>
<asp:Image ID="iQDate" runat="server" ImageUrl="~/images/Calendar.png"
Visible="False" />
<cc1:CalendarExtender ID="calQDate" runat="server" BehaviorID="calQDate"
TargetControlID="txtQDate" PopupButtonID="iQDate" Format="dd/MM/yyyy">
</cc1:CalendarExtender>
<asp:RangeValidator ID="rvQDate" runat="server" ControlToValidate="txtQDate"
Display="Dynamic"
ErrorMessage="Invalid QDate." MaximumValue="DateTime.Now;" Type="Date"
CultureInvariantValues="True">*</asp:RangeValidator>
How can I solve this ?
I'm trying to validate user input date using range validator on a text box .
This code is throwing this exception
"The value 'DateTime.Now;' of the MaximumValue property of 'rvQDate' cannot
be converted to type 'Date'. "
<asp:TextBox ID="txtQDate" runat="server" Enabled="False"></asp:TextBox>
<asp:Image ID="iQDate" runat="server" ImageUrl="~/images/Calendar.png"
Visible="False" />
<cc1:CalendarExtender ID="calQDate" runat="server" BehaviorID="calQDate"
TargetControlID="txtQDate" PopupButtonID="iQDate" Format="dd/MM/yyyy">
</cc1:CalendarExtender>
<asp:RangeValidator ID="rvQDate" runat="server" ControlToValidate="txtQDate"
Display="Dynamic"
ErrorMessage="Invalid QDate." MaximumValue="DateTime.Now;" Type="Date"
CultureInvariantValues="True">*</asp:RangeValidator>
How can I solve this ?