MetaModel.GetActionPath(String, String, Object) 方法

定义

返回与特定表关联的操作路径。

public:
 System::String ^ GetActionPath(System::String ^ tableName, System::String ^ action, System::Object ^ row);
public:
 virtual System::String ^ GetActionPath(System::String ^ tableName, System::String ^ action, System::Object ^ row);
public string GetActionPath (string tableName, string action, object row);
member this.GetActionPath : string * string * obj -> string
abstract member GetActionPath : string * string * obj -> string
override this.GetActionPath : string * string * obj -> string
Public Function GetActionPath (tableName As String, action As String, row As Object) As String

参数

tableName
String

对其应用操作的表的名称。

action
String

要应用于表的操作。

row
Object

一个对象,表示表中的一行数据。 row 用于为查询字符串参数提供值。

返回

String

与路由关联的 URL。

示例

以下示例演示如何使用 GetActionPath(String, String, Object) 该方法来评估路由路径, (确定指定表的 URL) 。 有关完整示例,请参见MetaModel

// Get the registered action path.
public string EvaluateActionPath()
{
    string tableName = LinqDataSource1.TableName;
    
    MetaModel model = GetModel(false);

    string actionPath =
        model.GetActionPath(tableName,
            System.Web.DynamicData.PageAction.List, GetDataItem());
    return actionPath;
}
' Get the registered action path.
Public Function EvaluateActionPath() As String
    Dim tableName As String = LinqDataSource1.TableName

    Dim model As MetaModel = GetModel(False)

    Dim actionPath As String = model.GetActionPath(tableName, System.Web.DynamicData.PageAction.List, GetDataItem())
    Return actionPath
End Function

注解

路由由表名称和操作的组合确定。

运行 此功能的联机示例。

适用于