Partilhar via


MetaModel.GetActionPath(String, String, Object) Método

Definição

Retorna o caminho da ação associado a uma tabela específica.

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

Parâmetros

tableName
String

O nome da tabela à qual a ação se aplica.

action
String

A ação a ser aplicada à tabela.

row
Object

Um objeto que representa uma única linha de dados em uma tabela. row é usada para fornecer valores para parâmetros de cadeia de consulta.

Retornos

String

A URL associada à rota.

Exemplos

O exemplo a seguir mostra como usar o GetActionPath(String, String, Object) método para avaliar o caminho de roteamento (determinar a URL) de uma tabela especificada. Para obter um exemplo completo, consulte 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

Comentários

A rota é determinada pela combinação do nome da tabela e da ação.

Execute um exemplo online desse recurso.

Aplica-se a