Web Form with 2 different validation points

  • Thread starter Thread starter TCORDON
  • Start date Start date
T

TCORDON

I have a Webform that contains 2 user controls, each one of them has some
fields in which the user can type different information, each one allows to
submit, BUT, haw can i manage to validate each form, if I set any of the two
submit buttons to "CauseValidation" they will perform validation on the 2
forms not just in the one the pressed the submit button on.

TIA!
 
TCORDON,

One way to get you over the line would be:
set up a hidden field on your form,
add some javascript to update this field from both user controls' buttons to
say 1 or 2,
then on Page_Load event disable validation for the other user control (you
may want to disable your validators on Client as well - just use enabled
property).

This way only the required validation will be triggered.
 
Back
Top