Validation groups and IValidator problem (ASP.NET 2.0)

Discussion in 'ASP .Net Web Controls' started by A.J. van der Burg, Dec 9, 2005.

  1. Hi all,

    I have a serious problem with asp.net 2.0 validation: I developed a custom
    validation summary control, which will lookup error messages from an external
    source based on the BaseValidator.ErrorMessage property. This validation
    summary control has a custom method which will add a dummy validator (which
    will always evaluate to false) to the Page.Validators collection. The dummy
    validator implements the IValidator interface, and this structure worked fine
    on ASP.NET 1.1.

    However, ASP.NET 2.0 supports validation groups, so I decided to add a
    custom 'ValidationGroup' property to the dummy validator class, because I
    want my custom validation summary control to support this much-welcomed
    feature. The problem is that the Page.GetValidators(string validationGroup)
    will loop through the page's Validators collection and cast each validator to
    a BaseValidator! This way, my custom validator is casted to a null value and
    won't be added to the collection of validators returned by the
    Page.GetValidators method.

    Does anybody have any suggestions how to resolve this?

    TIA,

    Arnold Jan van der Burg
    MCSD
    A.J. van der Burg, Dec 9, 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. Martin
    Replies:
    0
    Views:
    1,093
    Martin
    May 19, 2005
  2. =?Utf-8?B?QS5KLiB2YW4gZGVyIEJ1cmc=?=

    Validationgroups and IValidator problem (ASP.NET 2.0)

    =?Utf-8?B?QS5KLiB2YW4gZGVyIEJ1cmc=?=, Dec 9, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,609
    =?Utf-8?B?QS5KLiB2YW4gZGVyIEJ1cmc=?=
    Dec 9, 2005
  3. brantman

    Ivalidator and Validation Groups

    brantman, Jul 31, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    2,110
    Teemu Keiski
    Aug 1, 2006
  4. brantman

    IValidator and Validation Groups

    brantman, Jul 31, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    113
    brantman
    Jul 31, 2006
  5. Craig

    ASP.Net 2.0 Validation Groups & IValidator Controls.

    Craig, Sep 25, 2006, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    404
    Carl Reid
    Nov 10, 2006
Loading...

Share This Page