Dynamically adding validation controls to a validation summary

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a number of validation controls on a webform and a validation summary.
Two of the controls are hidden (contained in a Fieldset that is hidden) when
the page is first loaded and I want to add them to the validation summary
depending on a selection made in a dropdownlist on the form.

In the page load event I have added an If IsPostBack statement and tried to
add the new controls with the add event but that does not work.

Any ideas?

Thanks
 
Hmm, if the controls are hidden they're not rendered. The ValidationSummary
works for all validation controls on a given page, so the server roundtrip
after making a selection in your list, should work. I wonder though, if
you're enabling/disabling the validation controls as well as the controls to
validate, or just the validation controls? Your Fieldset, of which type is
it, and how is it hidden?
 
Back
Top