|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
CompareValidator for dates > than todaytoday, but I am getting an error. I am using : <asp:CompareValidator runat="server" ControlToCompare="RequestedStartDate" Operator="GreaterThan" Display="Dynamic" ValueToCompare = DateTime.Today.ToShortDateString() Type="Date" text="<br>Invalid Start Date"/> But it gives me an error:The value 'DateTime.Today()' of the ValueToCompare property of '' cannot be converted to type 'Date' I also tried DateTime.Today(), but got the same error. How would I do this? Thanks, Tom Actually, this went into the wrong group.
It should have gone into the asp.net group. Tom Show quote "tshad" <tscheider***@ftsolutions.com> wrote in message news:%23ke9$KIGGHA.3624@TK2MSFTNGP09.phx.gbl... >I am trying to check the date of my field to check if it is greater that >today, but I am getting an error. > > I am using : > > <asp:CompareValidator runat="server" > ControlToCompare="RequestedStartDate" > Operator="GreaterThan" > Display="Dynamic" > ValueToCompare = DateTime.Today.ToShortDateString() > Type="Date" text="<br>Invalid Start Date"/> > > But it gives me an error: > > The value 'DateTime.Today()' of the ValueToCompare property of '' cannot > be converted to type 'Date' > > I also tried DateTime.Today(), but got the same error. How would I do > this? > > Thanks, > > Tom > |
|||||||||||||||||||||||