Compare Validator not comparing date

Discussion in 'ASP .Net' started by =?Utf-8?B?YmFieg==?=, May 27, 2005.

  1. Hi

    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"
    Operator="LessThanEqual"></asp:CompareValidator>

    Need Help
    =?Utf-8?B?YmFieg==?=, May 27, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. .Net Sports
    Replies:
    1
    Views:
    2,651
    intrader
    Jun 25, 2005
  2. =?Utf-8?B?SklNLkgu?=

    Q: compare validator for date

    =?Utf-8?B?SklNLkgu?=, Aug 26, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    8,061
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tp?=
    Aug 26, 2005
  3. Peter Grison

    Date, date date date....

    Peter Grison, May 28, 2004, in forum: Java
    Replies:
    10
    Views:
    3,252
    Michael Borgwardt
    May 30, 2004
  4. Mike P

    Compare Validator and date format

    Mike P, Jun 6, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    3,358
    Mike P
    Jun 6, 2006
  5. Shailesh Katti

    compare validator to validate date in user control

    Shailesh Katti, Jul 27, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    705
    Teemu Keiski
    Jul 28, 2003
Loading...

Share This Page