Export (0) Print
Expand All

MetaModel.GetActionPath Method

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

Namespace:  System.Web.DynamicData
Assembly:  System.Web.DynamicData (in System.Web.DynamicData.dll)

public string GetActionPath(
	string tableName,
	string action,
	Object row
)

Parameters

tableName
Type: System.String
The name of the table that the action applies to.
action
Type: System.String
The action to apply to the table.
row
Type: System.Object
An object that represents a single row of data in a table. row is used to provide values for query-string parameters.

Return Value

Type: System.String
The URL that is associated with the route.

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

Run an online example of this feature.

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;
}


.NET Framework

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2014 Microsoft