Sdílet prostřednictvím


MetaModel.GetActionPath(String, String, Object) Metoda

Definice

Vrátí cestu akce přidruženou ke konkrétní tabulce.

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

Parametry

tableName
String

Název tabulky, na kterou se akce vztahuje.

action
String

Akce, která se má použít pro tabulku.

row
Object

Objekt, který představuje jeden řádek dat v tabulce. row slouží k zadání hodnot parametrů řetězce dotazu.

Návraty

String

Adresa URL přidružená k trase.

Příklady

Následující příklad ukazuje, jak použít metodu GetActionPath(String, String, Object) k vyhodnocení cesty směrování (určení adresy URL) pro zadanou tabulku. Úplný příklad najdete v tématu 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

Poznámky

Trasa je určena kombinací názvu tabulky a akce.

Spusťte online příklad této funkce.

Platí pro