Groups | Blog | Home
all groups > asp.net > april 2006 >

asp.net : validating groups of validators in 1.1


Darrel
4/24/2006 9:42:10 PM
I noticed this nice new feature in 2.0:

a.. Validation Groups - Validation groups allow multiple forms on a page to
be separately validated.

Alas, I'm using 1.1 on a project at the moment and need to do exactly that.

Any best-method way to handle that with 1.1?

I have one ASP.net form on the page, but two seperate sets of fields I want
to validate depending on which button I click.

Is it just a matter of this?:

button click handler()
validator1.validate()
validator2.validate()
...
validator9.validate()

if validator1.isvalid AND validator2.isvalid AND... validator9.isvalid()
do your thing
end if


-Darrel

Darrel
4/24/2006 10:07:01 PM
As a followup, I tried just that (only validating the specific controls).

However, it still seems as if my reuired field validators are validating
even when I am not explicitely telling them to. Do those behave different
than the rest for some reason?

-Darrel

Patrick.O.Ige
4/25/2006 12:00:00 AM
Darrel i don't think you can do what you want with ASP.NEt1.1
if i understand you i think your problem is that your validations are
clashing?
Try setting causesvalidation to false so they won't clash.
Patrick

[quoted text, click to view]

Darrel
4/25/2006 8:21:03 AM
[quoted text, click to view]

aha! Excellent. Thanks!

-Darrel

AddThis Social Bookmark Button