CustomValidator error doesl not show in ValidationSummary

Discussion in 'ASP .Net Web Controls' started by Nir Erlich, Sep 15, 2003.

  1. Nir Erlich

    Nir Erlich Guest


    I have a custom validator on my web form among other validators, I am
    trying to show all the error messages through a validation summary
    control but the custom validation seem to always show its messages

    Any way around it? much appreciates.
    Nir Erlich, Sep 15, 2003
    1. Advertisements

  2. I think you need to set the Display to None for that Validator. Then it
    will show in the summary.

    Michael Pearson, Sep 15, 2003
    1. Advertisements

  3. Nir Erlich

    Nir Erlich Guest

    Thanks, I have already done so but it doesn't seem to make any difference.
    Nir Erlich, Sep 16, 2003
  4. Nir Erlich

    Teemu Keiski Guest

    Do you perhaps mean getting the error message in the alert box that is
    displayed with ValidationSummary? And if that's the case, does your
    CustomValidator do the validation only at server-side?

    Teemu Keiski
    MCP, Designer/Developer

    AspInsiders Member,
    ASP.NET Forums Moderator,
    AspAlliance Columnist,
    Teemu Keiski, Sep 16, 2003
  5. Nir Erlich

    Nir Erlich Guest

    that's correct but in fact the only validation I have with the custom
    validators is the client side. here is the code:

    <asp:customvalidator id="Customvalidator1" Display="None"
    ClientValidationFunction="ValidatepageData();" ErrorMessage="Please
    choose a reason" Runat="Server"
    <asp:requiredfieldvalidator id="Requiredfieldvalidator1"
    Display="None" ErrorMessage="Please enter a course name"
    Runat="Server" NAME="Requiredfieldvalidator1"
    <asp:requiredfieldvalidator id="Requiredfieldvalidator3"
    Display="None" ErrorMessage="Please enter the course start date"
    Runat="Server" NAME="Requiredfieldvalidator2"
    <asp:requiredfieldvalidator id="Requiredfieldvalidator4"
    Display="None" ErrorMessage="Please enter the course end date"
    Runat="Server" NAME="Requiredfieldvalidator2"
    <asp:customvalidator id="Customvalidator3" Display="None"
    ClientValidationFunction="validDate();" ErrorMessage="Please enter a
    valid date" Runat="Server"
    <asp:customvalidator id="Customvalidator2" Display="None"
    ClientValidationFunction="checkDates();" ErrorMessage="Start date
    can't be greater then end date" Runat="Server"
    <asp:requiredfieldvalidator id="Requiredfieldvalidator2"
    Display="None" ErrorMessage="Please enter the course duration"
    Runat="Server" NAME="Requiredfieldvalidator2"
    <asp:rangevalidator id="RangeValidator1" Display="None"
    ErrorMessage="Please entere a valid duration value" Runat="server"
    ControlToValidate="txtCourseDuration" MinimumValue="0"
    MaximumValue="1000" Type="Integer"></asp:rangevalidator>
    <asp:validationsummary id="Validationsummary1" Runat="Server"
    NAME="Validationsummary1" DisplayMode="List" ShowSummary="False"
    ShowMessageBox="True" HeaderText="Please check the

    I'm thinking of going back to the good old way of validating values
    with direct calls to js functions, it's getting a bit silly with all
    these validators...
    Nir Erlich, Sep 17, 2003
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.