ClientScriptManager::RegisterForEventValidation Method (String, String)
Registers an event reference for validation with a unique control ID and event arguments representing the client control generating the event.
Assembly: System.Web (in System.Web.dll)
Parameters
- uniqueId
- Type: System::String
A unique ID representing the client control generating the event.
- argument
- Type: System::String
Event arguments passed with the client event.
| Exception | Condition |
|---|---|
| InvalidOperationException | The method is called prior to the Render method. |
The following code example demonstrates using the RegisterForEventValidation method and the ValidateEvent method to register a callback for validation and to validate that the callback originated from the page. To improve on the validation shown in the example, you could modify the validation argument parameter to contain information specific to the user such as an identity or role
The following code example demonstrates using the RegisterForEventValidation method to register a callback for 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.