Validation Summary

Posted on 2012-08-13
Last Modified: 2012-08-14
I have inherited a page with the following tag (that works fine)
<asp:ValidationSummary ID="ValSummary" runat="server" CssClass="Error" HeaderText="Please correct these errors and try to submit again" />

However...I need to add some date validation logic in the vb page for expiration date and birth date validations

How do I fire off the summary if the vbcode requirements are not met as well?

The textbox getting filled is txtBirthDate
It has a compare validator cpvBirthDate linked to it. (ControlToValidate="txtBirthDate")
That keeps the formating correct
Question by:lrbrister
    LVL 83

    Expert Comment


    Author Comment

    Code Cruiser

    So...should I set the Validator itself to fire with a different text label?

    here's the issue.
    The validator simply checks to see if it's in the right format.  08-01-2012

    The vb code verifies it's a valid birth date.
    NOT > now() and at least 18 years old.
    LVL 83

    Accepted Solution

    You mean you are using a custom validator not a compare validator? If so, you have to set the e.valid property to false and validation summary will appear automatically. Otherwise, show your aspx code.

    Author Closing Comment

    As always. Thanks

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
    A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    6 Experts available now in Live!

    Get 1:1 Help Now