LinkExtensions.BuildUrlFromExpression<TController> Method
Builds a URL from the given expression.
Namespace: Microsoft.Web.Mvc
Assembly: Microsoft.Web.Mvc (in Microsoft.Web.Mvc.dll)
Syntax
'Declaration
<ExtensionAttribute> _
Public Shared Function BuildUrlFromExpression(Of TController As Controller) ( _
helper As HtmlHelper, _
action As Expression(Of Action(Of TController)) _
) As String
'Usage
Dim helper As HtmlHelper
Dim action As Expression(Of Action(Of TController))
Dim returnValue As String
returnValue = helper.BuildUrlFromExpression(action)
public static string BuildUrlFromExpression<TController>(
this HtmlHelper helper,
Expression<Action<TController>> action
)
where TController : Controller
[ExtensionAttribute]
public:
generic<typename TController>
where TController : Controller
static String^ BuildUrlFromExpression(
HtmlHelper^ helper,
Expression<Action<TController>^>^ action
)
static member BuildUrlFromExpression :
helper:HtmlHelper *
action:Expression<Action<'TController>> -> string when 'TController : Controller
JScript does not support generic types and methods.
Type Parameters
- TController
The Controller Type.
Parameters
- helper
Type: System.Web.Mvc.HtmlHelper
The HtmlHelper where to build the URL.
- action
Type: System.Linq.Expressions.Expression<Action<TController>>
The method to build the URL.
Return Value
Type: System.String
A String representing the URL.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type HtmlHelper. When you use instance method syntax to call this method, omit the first parameter. For more information, see https://msdn.microsoft.com/en-us/library/bb384936(v=vs.118) or https://msdn.microsoft.com/en-us/library/bb383977(v=vs.118).