Updates and returns the value of the Parameter object.
Namespace:
System.Web.UI.WebControls
Assembly:
System.Web (in System.Web.dll)
Visual Basic (Declaration)
Protected Overridable Function Evaluate ( _
context As HttpContext, _
control As Control _
) As Object
Dim context As HttpContext
Dim control As Control
Dim returnValue As Object
returnValue = Me.Evaluate(context, _
control)
protected virtual Object Evaluate(
HttpContext context,
Control control
)
protected:
virtual Object^ Evaluate(
HttpContext^ context,
Control^ control
)
protected function Evaluate(
context : HttpContext,
control : Control
) : Object
Return Value
Type:
System..::.ObjectAn object that represents the updated and current value of the parameter.
The default implementation of the Evaluate method is to return nullNothingnullptra null reference (Nothing in Visual Basic) in all cases. Classes that derive from the Parameter class override the Evaluate method to return an updated parameter value. For example, the ControlParameter object returns the value of the control that it is bound to, while the QueryStringParameter object retrieves the current name/value pair from the HttpRequest object.
The following code example demonstrates how to override the Evaluate method to return the correct value in a class that is derived from the Parameter class. This code example is part of a larger example provided for the Parameter class overview.
' The Evaluate method is overridden to return the
' DataValue property instead of the DefaultValue.
Protected Overrides Function Evaluate(context As HttpContext, control As Control) As Object
If context Is Nothing Then
Return Nothing
Else
Return DataValue
End If
End Function
// The Evaluate method is overridden to return the
// DataValue property instead of the DefaultValue.
protected override object Evaluate(HttpContext context, Control control) {
if (context.Request == null)
return null;
return DataValue;
}
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.
.NET Framework
Supported in: 3.5, 3.0, 2.0
Reference