Validationgroups and IValidator problem (ASP.NET 2.0)

G

Guest

Hi all,

I have a serious problem with asp.net 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
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top