Bewerken

Delen via


RouteValueExpressionBuilder.GetRouteValue(Page, String, Type, String) Method

Definition

Retrieves the value that corresponds to the specified URL parameter.

public:
 static System::Object ^ GetRouteValue(System::Web::UI::Page ^ page, System::String ^ key, Type ^ controlType, System::String ^ propertyName);
public static object GetRouteValue (System.Web.UI.Page page, string key, Type controlType, string propertyName);
static member GetRouteValue : System.Web.UI.Page * string * Type * string -> obj
Public Shared Function GetRouteValue (page As Page, key As String, controlType As Type, propertyName As String) As Object

Parameters

page
Page

The current page.

key
String

The URL parameter.

controlType
Type

The type of the control that the expression is bound to.

propertyName
String

The name of the property that is being set by the expression.

Returns

The value that corresponds to the specified URL parameter for the current page. If page is null, if the RouteData property of page is null, or if key is empty or null, the method returns null.

Remarks

This method retrieves the appropriate value for the specified key value by using the RouteData property of page. It then uses the controlType and propertyName values to find the appropriate type converter in order to convert the retrieved value into the correct type.

Applies to

See also