BaseValidator.ValidationGroup Property
Assembly: System.Web (in system.web.dll)
[ThemeableAttribute(false)] public: virtual property String^ ValidationGroup { String^ get (); void set (String^ value); }
/** @property */ public String get_ValidationGroup () /** @property */ public void set_ValidationGroup (String value)
public function get ValidationGroup () : String public function set ValidationGroup (value : String)
Not applicable.
Property Value
The name of the validation group to which this validation control belongs. The default is an empty string (""), which indicates that this property is not set.ASP.NET provides many controls that have the ability to post back to the server. When one of these controls has its CausesValidation property set to true, validation is performed when the control posts back to server. The following controls have the ability to post back to the server:
Note: |
|---|
| Some of these controls post back to the server only when the AutoPostBack property is set to true. |
These controls each have a ValidationGroup property that, when set, validates only the validation controls within the specified group when the control triggers a post back to the server. Use the ValidationGroup property to assign a validation control to a validation group. The Page class also exposes a GetValidators method and a Validate method that accept a ValidationGroup input parameter.
This property cannot be set by themes or style sheet themes. For more information, see ThemeableAttribute and Introduction to ASP.NET Themes.
| Topic | Location |
|---|---|
| Walkthrough: Validating User Input in a Web Forms Page | Building ASP .NET Web Applications in Visual Studio |
The following code example demonstrates how to use the ValidationGroup property to assign a validation control to a group.
Security Note: |
|---|
| This example has a text box that accepts user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see Script Exploits Overview (Visual Studio). |
Note: