ServerValidateEventArgs Class
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 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.