ServerValidateEventArgs Class
Provides data for the ServerValidate event of the CustomValidator control. This class cannot be inherited.
Assembly: System.Web (in System.Web.dll)
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.
- AspNetHostingPermission
for operating in a hosted environment. Demand value: LinkDemand. Permission value: Minimal.
- AspNetHostingPermission
for operating in a hosted environment. Demand value: InheritanceDemand. Permission value: Minimal.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.