0

I have a panel, controls in the panel..these controls validated with a validation group.

This panel will show / hide when a dropdown box changes.

Question is...i want to validate all the controls with validation group in the panel

how to write the code

Michal Klouda
  • 14,263
  • 7
  • 53
  • 77
donga garu
  • 69
  • 2
  • 13

1 Answers1

0

You define validationgroup="Test" on your validators , and you define also this validationgroup="Test" on your Button.

Sample

     .....
     <asp:requiredfieldvalidator id="NameTextBoxRequiredValidator" 
        controltovalidate="NameTextBox"
        display="Dynamic" 
        text="Please enter your name."
        validationgroup="ForPanel"  <----------------
        runat="server"/>

      <asp:button id="SubmitButton"
        text="Submit"
        validationgroup="ForPanel"  <------------------
        runat="server"/>

Nota : Gets or sets the name of the validation group to which this validation control belongs.

Aghilas Yakoub
  • 28,516
  • 5
  • 46
  • 51