UrlResolutionTagHelper Třída

Definice

ITagHelper implementace cílená na elementy obsahující atributy s očekávanými hodnotami adresy URL.

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
Dědičnost
UrlResolutionTagHelper
Odvozené
Atributy

Poznámky

Přeloží adresy URL začínající na ~/(vzhledem k nastavení webroot aplikace), na které ostatní adresy necílí ITagHelper. Spustí se před jinými ITagHelpery, aby se zajistilo, že se přeloží adresy URL relativní k aplikaci.

Konstruktory

UrlResolutionTagHelper(IUrlHelperFactory, HtmlEncoder)

Vytvoří nový objekt UrlResolutionTagHelper.

Vlastnosti

HtmlEncoder

Hodnota HtmlEncoder

Order

Při spuštění sady ITagHelpers jsou nejprve vyvolány jejich Init(TagHelperContext)'s v zadaném Order; pak jsou jejich ProcessAsync(TagHelperContext, TagHelperOutput)'s vyvolány v zadaném Order. Nižší hodnoty se spustí jako první.

UrlHelperFactory

Hodnota IUrlHelperFactory

ViewContext

Hodnota ViewContext

Metody

Init(TagHelperContext)

Inicializuje s ITagHelper daným context. Items V rámci této metody byste měli provést přidání, aby se zajistilo, že budou přidány před spuštěním podřízených položek.

(Zděděno od TagHelper)
Process(TagHelperContext, TagHelperOutput)

Synchronně spustí s TagHelper danými context a output.

ProcessAsync(TagHelperContext, TagHelperOutput)

Asynchronně provede s TagHelper danými context a output.

(Zděděno od TagHelper)
ProcessUrlAttribute(String, TagHelperOutput)

Přeloží a aktualizuje hodnoty adresy URL začínající na ~/(vzhledem k nastavení webroot aplikace) pro output' s Attributes , jejichž Name hodnota je attributeName.

TryResolveUrl(String, IHtmlContent)

Pokusí se vyřešit danou url hodnotu vzhledem k nastavení webroot aplikace.

TryResolveUrl(String, String)

Pokusí se vyřešit danou url hodnotu vzhledem k nastavení webroot aplikace.

Platí pro