I have a ValidationGroup declared for my validator and button. But I see that there is this property for the textbox as well... do I need to assign this? What is the purpose of a textbox having a ValidationGroup when it is supposed to be the validator controls that have this?
A:
No, you do not need to assign the ValidationGroup property on the Textbox. Assigning it to the validator is all you need to do.
citronas
2010-07-11 10:18:52
+1
A:
The TextBox has a ValidationGroup because it is possible for the TextBox itself to cause a post back to the server (if you set its AutoPostBack property to true). The ValidationGroup of the TextBox is the group of controls that are validated in this event.
If you are using a button to cause the post back event then the ValidationGroup on the TextBox does not need to be set.
There is more information on MSDN.
James Gaunt
2010-07-11 10:23:31