RouteValueExpressionBuilder.GetRouteValue(Page, String, Type, String) 方法

定义

检索与指定的 URL 参数相对应的值。

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

参数

page
Page

当前页。

key
String

URL 参数。

controlType
Type

表达式所绑定的控件的类型。

propertyName
String

表达式所设置的属性的名称。

返回

Object

与为当前页指定的 URL 参数对应的值。 如果 pagenullpageRouteData 属性为 null,或者 key 为空或为 null,则此方法返回 null

注解

此方法使用 的 属性检索指定 keyRouteData 的适当值 page 。 然后,它使用 和 值查找适当的类型转换器,以便将检索到的值 controlType propertyName 转换为正确的类型。

适用于

另请参阅