ServerValidateEventArgs Class
Provides data for the ServerValidate event of the CustomValidator control. This class cannot be inherited.
Assembly: System.Web (in System.Web.dll)
The ServerValidateEventArgs type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | ServerValidateEventArgs | Initializes a new instance of the ServerValidateEventArgs class. |
| Name | Description | |
|---|---|---|
![]() | IsValid | Gets or sets whether the value specified by the Value property passed validation. |
![]() | Value | Gets the value to validate in the custom event handler for the ServerValidate event. |
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
A ServerValidateEventArgs is passed to the ServerValidate event handler to provide event data to the handler. The ServerValidate event is raised when validation is performed on the server. This allows you to perform a custom server-side validation routine on the value of an input control (with a CustomValidator control associated with it) in the event handler.
The value to validate is determined by using the Value property. Once your code has determined whether the value is valid, store the results of the validation in the IsValid property.
For a list of initial property values for an instance of ServerValidateEventArgs, see the ServerValidateEventArgs constructor.
For more information about handling events, see Consuming Events.
| Topic | Location |
|---|---|
| Walkthrough: Validating User Input in a Web Forms Page | Building ASP .NET Web Applications in Visual Studio |
The following example demonstrates how to use a ServerValidateEventArgs to pass event data to a custom event handler for the ServerValidate event. Notice that the Value property of the ServerValidateEventArgs is used to determine the value to validate, while the IsValid property is used to store the results of the validation.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.


