ServerValidateEventArgs Class


Provides data for the ServerValidate event of the CustomValidator control. This class cannot be inherited.

Namespace:   System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)


public ref class ServerValidateEventArgs : EventArgs

System_CAPS_pubmethodServerValidateEventArgs(String^, Boolean)

Initializes a new instance of the ServerValidateEventArgs class.


Gets or sets whether the value specified by the Value property passed validation.


Gets the value to validate in the custom event handler for the ServerValidate event.


Determines whether the specified object is equal to the current object.(Inherited from Object.)


Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)


Serves as the default hash function. (Inherited from Object.)


Gets the Type of the current instance.(Inherited from Object.)


Creates a shallow copy of the current Object.(Inherited from Object.)


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 NIB: Consuming Events.

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.

No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top