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 是用來提供查詢字串參數的值。

傳回

與路徑相關聯的 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

備註

路由是由資料表名稱和動作的組合所決定。

執行 此功能的線上範例。

適用於