AnchorTagHelper Class

Summary

@!:ITagHelper- implementation targeting <a> elements.

Syntax

public class AnchorTagHelper : TagHelper

GitHub

View on GitHub

class Microsoft.AspNet.Mvc.TagHelpers.AnchorTagHelper

Constructors

AnchorTagHelper(Microsoft.AspNet.Mvc.Rendering.IHtmlGenerator)

Creates a new [Microsoft.AspNet.Mvc.TagHelpers.AnchorTagHelper](Microsoft.AspNet.Mvc.TagHelpers.AnchorTagHelper.yml).

Arguments:
public AnchorTagHelper(IHtmlGenerator generator)

Properties

Action()

The name of the action method.

Return type:System.String
public string Action { get; set; }
Controller()

The name of the controller.

Return type:System.String
public string Controller { get; set; }
Fragment()

The URL fragment name.

Return type:System.String
public string Fragment { get; set; }
Generator()
Return type:Microsoft.AspNet.Mvc.Rendering.IHtmlGenerator
protected IHtmlGenerator Generator { get; }
Host()

The host name.

Return type:System.String
public string Host { get; set; }
Protocol()

The protocol for the URL, such as “http” or “https”.

Return type:System.String
public string Protocol { get; set; }
Route()

Name of the route.

Return type:System.String
public string Route { get; set; }
RouteValues()

Additional parameters for the route.

Return type:System.Collections.Generic.IDictionary{System.String,System.String}
public IDictionary<string, string> RouteValues { get; set; }

Methods

Process(TagHelperContext, TagHelperOutput)
Arguments:
  • context (TagHelperContext) –
  • output (TagHelperOutput) –
public override void Process(TagHelperContext context, TagHelperOutput output)