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

    Hi,

    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
    separately.

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

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

    Michael


    "Nir Erlich" <> wrote in message
    news:...
    > Hi,
    >
    > 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
    > separately.
    >
    > Any way around it? much appreciates.



    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.518 / Virus Database: 316 - Release Date: 9/11/2003
    Michael Pearson, Sep 15, 2003
    #2
    1. Advertising

  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
    #3
  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, www.aspinsiders.com
    ASP.NET Forums Moderator, www.asp.net
    AspAlliance Columnist, www.aspalliance.com


    "Nir Erlich" <> wrote in message
    news:...
    > Thanks, I have already done so but it doesn't seem to make any difference.
    Teemu Keiski, Sep 16, 2003
    #4
  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"
    NAME="Customvalidator1"></asp:customvalidator>
    <asp:requiredfieldvalidator id="Requiredfieldvalidator1"
    Display="None" ErrorMessage="Please enter a course name"
    Runat="Server" NAME="Requiredfieldvalidator1"
    ControlToValidate="txtCourseName"></asp:requiredfieldvalidator>
    <asp:requiredfieldvalidator id="Requiredfieldvalidator3"
    Display="None" ErrorMessage="Please enter the course start date"
    Runat="Server" NAME="Requiredfieldvalidator2"
    ControlToValidate="txtStart"></asp:requiredfieldvalidator>
    <asp:requiredfieldvalidator id="Requiredfieldvalidator4"
    Display="None" ErrorMessage="Please enter the course end date"
    Runat="Server" NAME="Requiredfieldvalidator2"
    ControlToValidate="txtEnd"></asp:requiredfieldvalidator>
    <asp:customvalidator id="Customvalidator3" Display="None"
    ClientValidationFunction="validDate();" ErrorMessage="Please enter a
    valid date" Runat="Server"
    NAME="Customvalidator3"></asp:customvalidator>
    <asp:customvalidator id="Customvalidator2" Display="None"
    ClientValidationFunction="checkDates();" ErrorMessage="Start date
    can't be greater then end date" Runat="Server"
    NAME="Customvalidator2"></asp:customvalidator>
    <asp:requiredfieldvalidator id="Requiredfieldvalidator2"
    Display="None" ErrorMessage="Please enter the course duration"
    Runat="Server" NAME="Requiredfieldvalidator2"
    ControlToValidate="txtCourseDuration"></asp:requiredfieldvalidator>
    <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
    following:"></asp:validationsummary>

    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
    #5
    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. SMG
    Replies:
    1
    Views:
    1,493
    John Saunders
    Jul 26, 2004
  2. dw
    Replies:
    2
    Views:
    5,725
  3. =?Utf-8?B?THVrZSBNb3JlaGVhZA==?=

    CustomValidator not adding error to ValidationSummary

    =?Utf-8?B?THVrZSBNb3JlaGVhZA==?=, Aug 21, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    3,881
    Peter Blum
    Aug 22, 2005
  4. Mr. x

    validationSummary always show the HeaderText

    Mr. x, Dec 12, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    158
    Mr. x
    Dec 12, 2003
  5. Blibo Baggins
    Replies:
    4
    Views:
    1,386
    Steven Burton
    Nov 17, 2004
Loading...

Share This Page