Share via


UrlResolutionTagHelper Class

Definition

ITagHelper implementation targeting elements containing attributes with URL expected values.

public ref class UrlResolutionTagHelper : Microsoft::AspNetCore::Razor::TagHelpers::TagHelper
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("*", Attributes="[itemid^='~/']")]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("a", Attributes="[href^='~/']")]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("applet", Attributes="[archive^='~/']")]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("area", Attributes="[href^='~/']", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("audio", Attributes="[src^='~/']")]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("base", Attributes="[href^='~/']", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("blockquote", Attributes="[cite^='~/']")]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("button", Attributes="[formaction^='~/']")]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("del", Attributes="[cite^='~/']")]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("embed", Attributes="[src^='~/']", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("form", Attributes="[action^='~/']")]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("html", Attributes="[manifest^='~/']")]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("iframe", Attributes="[src^='~/']")]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("img", Attributes="[src^='~/']", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("img", Attributes="[srcset^='~/']", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("input", Attributes="[src^='~/']", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("input", Attributes="[formaction^='~/']", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("ins", Attributes="[cite^='~/']")]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("link", Attributes="[href^='~/']", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("menuitem", Attributes="[icon^='~/']")]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("object", Attributes="[archive^='~/']")]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("object", Attributes="[data^='~/']")]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("q", Attributes="[cite^='~/']")]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="[src^='~/']")]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("source", Attributes="[src^='~/']", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("source", Attributes="[srcset^='~/']", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("track", Attributes="[src^='~/']", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("video", Attributes="[src^='~/']")]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("video", Attributes="[poster^='~/']")]
public class UrlResolutionTagHelper : Microsoft.AspNetCore.Razor.TagHelpers.TagHelper
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("*", Attributes="[itemid^='~/']")>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("a", Attributes="[href^='~/']")>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("applet", Attributes="[archive^='~/']")>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("area", Attributes="[href^='~/']", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("audio", Attributes="[src^='~/']")>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("base", Attributes="[href^='~/']", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("blockquote", Attributes="[cite^='~/']")>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("button", Attributes="[formaction^='~/']")>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("del", Attributes="[cite^='~/']")>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("embed", Attributes="[src^='~/']", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("form", Attributes="[action^='~/']")>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("html", Attributes="[manifest^='~/']")>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("iframe", Attributes="[src^='~/']")>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("img", Attributes="[src^='~/']", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("img", Attributes="[srcset^='~/']", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("input", Attributes="[src^='~/']", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("input", Attributes="[formaction^='~/']", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("ins", Attributes="[cite^='~/']")>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("link", Attributes="[href^='~/']", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("menuitem", Attributes="[icon^='~/']")>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("object", Attributes="[archive^='~/']")>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("object", Attributes="[data^='~/']")>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("q", Attributes="[cite^='~/']")>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="[src^='~/']")>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("source", Attributes="[src^='~/']", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("source", Attributes="[srcset^='~/']", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("track", Attributes="[src^='~/']", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("video", Attributes="[src^='~/']")>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("video", Attributes="[poster^='~/']")>]
type UrlResolutionTagHelper = class
    inherit TagHelper
Public Class UrlResolutionTagHelper
Inherits TagHelper
Inheritance
UrlResolutionTagHelper
Derived
Attributes

Remarks

Resolves URLs starting with '~/' (relative to the application's 'webroot' setting) that are not targeted by other ITagHelpers. Runs prior to other ITagHelpers to ensure application-relative URLs are resolved.

Constructors

UrlResolutionTagHelper(IUrlHelperFactory, HtmlEncoder)

Creates a new UrlResolutionTagHelper.

Properties

HtmlEncoder

The HtmlEncoder.

Order

When a set of ITagHelpers are executed, their Init(TagHelperContext)'s are first invoked in the specified Order; then their ProcessAsync(TagHelperContext, TagHelperOutput)'s are invoked in the specified Order. Lower values are executed first.

UrlHelperFactory

The IUrlHelperFactory.

ViewContext

The ViewContext.

Methods

Init(TagHelperContext)

Initializes the ITagHelper with the given context. Additions to Items should be done within this method to ensure they're added prior to executing the children.

(Inherited from TagHelper)
Process(TagHelperContext, TagHelperOutput)

Synchronously executes the TagHelper with the given context and output.

ProcessAsync(TagHelperContext, TagHelperOutput)

Asynchronously executes the TagHelper with the given context and output.

(Inherited from TagHelper)
ProcessUrlAttribute(String, TagHelperOutput)

Resolves and updates URL values starting with '~/' (relative to the application's 'webroot' setting) for output's Attributes whose Name is attributeName.

TryResolveUrl(String, IHtmlContent)

Tries to resolve the given url value relative to the application's 'webroot' setting.

TryResolveUrl(String, String)

Tries to resolve the given url value relative to the application's 'webroot' setting.

Applies to