Share via


LinkExtensions.ActionLink Method

 

Creates an anchor tag.

Namespace:   Microsoft.Web.Mvc
Assembly:  Microsoft.Web.Mvc (in Microsoft.Web.Mvc.dll)

Overload List

Name Description
System_CAPS_pubmethodSystem_CAPS_static ActionLink<TController>(HtmlHelper, Expression<Action<TController>>, String)

Creates an anchor tag based on the passed in controller type and method.

System_CAPS_pubmethodSystem_CAPS_static 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

  • linkText
    Type: System.String

    The 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

  • linkText
    Type: System.String

    The linked text to appear on the page.

  • htmlAttributes
    Type: System.Object

    Any additional HTML attributes.

Return Value

Type: System.Web.Mvc.MvcHtmlString

The anchor tag.

Type Parameters

  • TController
    The Controller Type.

Return to top