This documentation is archived and is not being maintained.

ClientScriptManager::ValidateEvent Method (String, String)

Validates a client event that was registered for event validation using the RegisterForEventValidation method.

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

public:
void ValidateEvent(
	String^ uniqueId, 
	String^ argument
)

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.

ExceptionCondition
ArgumentException

uniqueId is nullptr or an empty string ("").

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 here, you could modify the validation argument parameter to contain information specific to the user such as an identity or role

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

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

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.
Show: