LinkExtensions.ActionLink Method
Creates an anchor tag.
Namespace: Microsoft.Web.Mvc
Assembly: Microsoft.Web.Mvc (in Microsoft.Web.Mvc.dll)
Overload List
Name | Description | |
---|---|---|
![]() ![]() |
ActionLink<TController>(HtmlHelper, Expression<Action<TController>>, String) | Creates an anchor tag based on the passed in controller type and method. |
![]() ![]() |
ActionLink<TController>(HtmlHelper, Expression<Action<TController>>, String, Object) | Creates an anchor tag based on the passed in controller type and method. |
See Also
LinkExtensions Class
Microsoft.Web.Mvc Namespace
Return to top
LinkExtensions.ActionLink<TController> Method (HtmlHelper, Expression<Action<TController>>, String)
Creates an anchor tag based on the passed in controller type and method.
Syntax
public static MvcHtmlString ActionLink<TController>(
this HtmlHelper helper,
Expression<Action<TController>> action,
string linkText
)
where TController : Controller
public:
generic<typename TController>
where TController : Controller
[ExtensionAttribute]
static MvcHtmlString^ ActionLink(
HtmlHelper^ helper,
Expression<Action<TController>^>^ action,
String^ linkText
)
static member ActionLink<'TController when 'TController : Controller> :
helper:HtmlHelper *
action:Expression<Action<'TController>> *
linkText:string -> MvcHtmlString
<ExtensionAttribute>
Public Shared Function ActionLink(Of TController As Controller) (
helper As HtmlHelper,
action As Expression(Of Action(Of TController)),
linkText As String
) As MvcHtmlString
Parameters
helper
Type: System.Web.Mvc.HtmlHelperThe HtmlHelper where to create the link.
action
Type: System.Linq.Expressions.Expression<Action<TController>>The Method to route to.
linkText
Type: System.StringThe linked text to appear on the page.
Return Value
Type: System.Web.Mvc.MvcHtmlString
The anchor tag.
Type Parameters
- TController
The Controller Type.
Return to top
LinkExtensions.ActionLink<TController> Method (HtmlHelper, Expression<Action<TController>>, String, Object)
Creates an anchor tag based on the passed in controller type and method.
Syntax
public static MvcHtmlString ActionLink<TController>(
this HtmlHelper helper,
Expression<Action<TController>> action,
string linkText,
object htmlAttributes
)
where TController : Controller
public:
generic<typename TController>
where TController : Controller
[ExtensionAttribute]
static MvcHtmlString^ ActionLink(
HtmlHelper^ helper,
Expression<Action<TController>^>^ action,
String^ linkText,
Object^ htmlAttributes
)
static member ActionLink<'TController when 'TController : Controller> :
helper:HtmlHelper *
action:Expression<Action<'TController>> *
linkText:string *
htmlAttributes:Object -> MvcHtmlString
<ExtensionAttribute>
Public Shared Function ActionLink(Of TController As Controller) (
helper As HtmlHelper,
action As Expression(Of Action(Of TController)),
linkText As String,
htmlAttributes As Object
) As MvcHtmlString
Parameters
helper
Type: System.Web.Mvc.HtmlHelperThe HtmlHelper where to create the link.
action
Type: System.Linq.Expressions.Expression<Action<TController>>The Method to route to.
linkText
Type: System.StringThe linked text to appear on the page.
htmlAttributes
Type: System.ObjectAny additional HTML attributes.
Return Value
Type: System.Web.Mvc.MvcHtmlString
The anchor tag.
Type Parameters
- TController
The Controller Type.
Return to top