This documentation is archived and is not being maintained.

ControlParameter.Evaluate Method

Updates and returns the value of the ControlParameter object.

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

protected internal override Object Evaluate(
	HttpContext context,
	Control control


Type: System.Web.HttpContext
The current HttpContext of the request.
Type: System.Web.UI.Control
The Control that the parameter is bound to.

Return Value

Type: System.Object
An Object that represents the updated and current value of the parameter.


The ControlID property is not set.

- or -

The PropertyName property is not set and the Control identified by the ControlID property is not decorated with a ControlValuePropertyAttribute attribute.


Control.FindControl does not return the specified control.

- or -

The control identified by the ControlID property does not support the property named by PropertyName.

The ControlParameter object attempts to bind to the Control object and property every time the Evaluate method is called. The Evaluate method returns the value of the control's property that is identified by the combination of the ControlID and PropertyName properties.

The ControlParameter class never uses the DefaultValue property, which is inherited from Parameter, when binding to a control's property value.


In this implementation of the method, the context parameter is ignored. If the control parameter is null, null is returned.

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