Home All Groups Group Topic Archive Search About

Dynamically adding validation controls to a validation summary

Author
13 Mar 2007 12:40 PM
Westicle
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
--
Westie

Author
18 Mar 2007 11:31 AM
<ct>
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?

--
Carsten Thomsen
Senior .NET Solutions Architect / Developer / Author
MCAD/MCSD/MCSE/MCTS
Show quote
"Westicle" <Westi***@discussions.microsoft.com> wrote in message
news:9E2AD6F9-01B1-4E52-B03D-5DA3D4CA11CD@microsoft.com...
>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
> --
> Westie

AddThis Social Bookmark Button