MetaModel.GetActionPath(String, String, Object) Method

Definition

Returns the action path that is associated with a specific table.

public string GetActionPath (string tableName, string action, object row);

Parameters

tableName
String

The name of the table that the action applies to.

action
String

The action to apply to the table.

row
Object

An object that represents a single row of data in a table. row is used to provide values for query-string parameters.

Returns

The URL that is associated with the route.

Examples

The following example shows how to use the GetActionPath(String, String, Object) method to evaluate the routing path (determine the URL) for a specified table. For a complete example, see 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;
}

Remarks

The route is determined by the combination of the table name and action.

Run an online example of this feature.

Applies to

Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1