Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Compare Validator not comparing date

Thread Tools

Compare Validator not comparing date

Posts: n/a

I am facing one peculiar problem. When I tried to compare control value
with the current date, it is not validating. All I am doing is

in the Page Load I have a code

cmp1.ValueToCompare = System.DateTime.Today.ToString("MM/dd/yyyy");

and my validator code is

<asp:CompareValidator id="cmp1" style="Z-INDEX: 104; LEFT: 488px; POSITION:
absolute; TOP: 40px" runat="server"
Width="400px" Height="24px" ErrorMessage="Expense Report Received Date
should be Less than or Equal to current date."
ControlToValidate="txt1" Type="Date"

Need Help

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compare Validator Date Format Anjut Software 1 10-26-2009 10:55 AM
Compare Validator and date format Mike P ASP .Net 0 06-06-2006 02:58 PM
Q: compare validator for date =?Utf-8?B?SklNLkgu?= ASP .Net 4 08-26-2005 04:01 PM
Date, date date date.... Peter Grison Java 10 05-30-2004 01:20 PM
compare validator to validate date in user control Shailesh Katti ASP .Net Web Controls 1 07-28-2003 11:20 AM