Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Validation groups and IValidator problem (ASP.NET 2.0)

Thread Tools

Validation groups and IValidator problem (ASP.NET 2.0)

A.J. van der Burg
Posts: n/a
Hi all,

I have a serious problem with 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?


Arnold Jan van der Burg

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.Net 2.0 Validation Groups & IValidator Controls. Craig ASP .Net Web Controls 1 11-10-2006 05:39 PM
Ivalidator and Validation Groups brantman ASP .Net 1 08-01-2006 06:01 PM
IValidator and Validation Groups brantman ASP .Net Web Controls 0 07-31-2006 07:48 PM
Validationgroups and IValidator problem (ASP.NET 2.0) =?Utf-8?B?QS5KLiB2YW4gZGVyIEJ1cmc=?= ASP .Net 0 12-09-2005 08:39 AM
TextBox:IValidator and a star (*) Shark Bait ASP .Net Web Controls 1 10-21-2005 09:07 PM