2.0: CompareValidator problem

Discussion in 'ASP .Net' started by R.A.M., Jun 26, 2006.

  1. R.A.M.

    R.A.M. Guest

    Hi,
    I am learning .NET 2.0 and I have a problem with asp:CompareValidator.
    On .aspx page I have:

    Birth date:
    <asp:TextBox ID="BirthDate" runat="server"
    ValidationGroup="BirthDate"/>

    and it works fine; but when I add:

    <asp:CompareValidator ID="BirthDateValidation" runat="server"
    ValidationGroup="BirthDate" ControlToValidate="BirthDate" Type="Date"
    Text="Enter birth date!" />

    then I have a problem of Application_Error().
    Could you help me please!?
    (Other validating controls work fine...)

    /RAM/
     
    R.A.M., Jun 26, 2006
    #1
    1. Advertising

  2. R.A.M.

    Mantorok Guest

    Re: CompareValidator problem

    You should be using a RequiredFieldValidator if you want to force the date,
    if you want to ensure it's a date then ensure that Operator="DataTypeCheck"
    is included.

    Kev

    "R.A.M." <> wrote in message
    news:...
    > Hi,
    > I am learning .NET 2.0 and I have a problem with asp:CompareValidator.
    > On .aspx page I have:
    >
    > Birth date:
    > <asp:TextBox ID="BirthDate" runat="server"
    > ValidationGroup="BirthDate"/>
    >
    > and it works fine; but when I add:
    >
    > <asp:CompareValidator ID="BirthDateValidation" runat="server"
    > ValidationGroup="BirthDate" ControlToValidate="BirthDate" Type="Date"
    > Text="Enter birth date!" />
    >
    > then I have a problem of Application_Error().
    > Could you help me please!?
    > (Other validating controls work fine...)
    >
    > /RAM/
     
    Mantorok, Jun 26, 2006
    #2
    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. Sjaakie Helderhorst

    Ivoking comparevalidator

    Sjaakie Helderhorst, Feb 25, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    330
    Sjaakie Helderhorst
    Feb 25, 2004
  2. Axel Dahmen

    CompareValidator problem

    Axel Dahmen, Apr 17, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    4,582
    Axel Dahmen
    Apr 20, 2004
  3. R.A.M.
    Replies:
    1
    Views:
    603
    Poornimab
    Jun 22, 2006
  4. pc
    Replies:
    0
    Views:
    119
  5. Andres Aguiar

    Problem with CompareValidator control

    Andres Aguiar, Jul 28, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    275
    Steven Cheng[MSFT]
    Jul 29, 2004
Loading...

Share This Page