-----Original Message-----
I just went through that having two user controls on a page and wanting to
validate only the set of controls associated with the user control
containing the button that was clicked.
The following article was very helpful.
http://msdn.microsoft.com/library/default.asp? url=/library/en-us/dnaspp/html/aspplusvalid.asp
What I basically came up with is:
Validators can be disabled on the client side using javascript, but will
still be evaluated when the form is posted back. Therefore you need a method
of determining which validators were disabled on the client side and disable
the same ones on the server side.
In my case I was working with editable datagrids and the validators were
contained in them. The clientId of all the grid's child controls includes
the ID of the datagrid.
In the OnMouseDown event of the 'submit' button I call a javascript function
and pass it the id of the datagrid.
The javascript function would loop through all the validators on the page
and enable only those whose id (ClientID on server side) contains the id
passed to the function.
A comma separated list of enabled validators is placed in a hidden text box.
Then on the server side in the page load event (if postback), I retrieve the
list of enabled validators from the hidden text box enable the validators in
the list and disable all others, before any are evaluated.
HTH.
--
Alphonse Giambrone
Email: a-giam at customdatasolutions dot us
.