ImageTagHelper Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
ITagHelper implementation targeting <img> elements that supports file versioning.
public ref class ImageTagHelper : Microsoft::AspNetCore::Mvc::Razor::TagHelpers::UrlResolutionTagHelper
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("img", Attributes="asp-append-version,src", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)]
public class ImageTagHelper : Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("img", Attributes="asp-append-version,src", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)>]
type ImageTagHelper = class
inherit UrlResolutionTagHelper
Public Class ImageTagHelper
Inherits UrlResolutionTagHelper
- Inheritance
- Attributes
Remarks
The tag helper won't process for cases with just the 'src' attribute.
Constructors
ImageTagHelper(IFileVersionProvider, HtmlEncoder, IUrlHelperFactory) |
Creates a new ImageTagHelper. |
ImageTagHelper(IHostingEnvironment, IMemoryCache, HtmlEncoder, IUrlHelperFactory) |
Obsolete.
Creates a new ImageTagHelper. |
ImageTagHelper(IHostingEnvironment, TagHelperMemoryCacheProvider, IFileVersionProvider, HtmlEncoder, IUrlHelperFactory) |
Creates a new ImageTagHelper. |
ImageTagHelper(IWebHostEnvironment, TagHelperMemoryCacheProvider, IFileVersionProvider, HtmlEncoder, IUrlHelperFactory) |
Obsolete.
Creates a new ImageTagHelper. This constructor is obsolete and will be removed in a future version. |
Properties
AppendVersion |
Value indicating if file version should be appended to the src urls. |
Cache |
Obsolete.
Gets the IMemoryCache used to store globbed urls. This property is obsolete and will be removed in a future version. |
HostingEnvironment |
Obsolete.
Gets the IWebHostEnvironment for the application. This property is obsolete and will be removed in a future version. |
HtmlEncoder |
The HtmlEncoder. (Inherited from UrlResolutionTagHelper) |
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. |
Src |
Source of the image. |
UrlHelperFactory |
The IUrlHelperFactory. (Inherited from UrlResolutionTagHelper) |
ViewContext |
The ViewContext. (Inherited from UrlResolutionTagHelper) |
Methods
Init(TagHelperContext) |
Initializes the ITagHelper with the given |
Process(TagHelperContext, TagHelperOutput) |
Synchronously executes the TagHelper with the given |
ProcessAsync(TagHelperContext, TagHelperOutput) |
Asynchronously executes the TagHelper with the given |
ProcessUrlAttribute(String, TagHelperOutput) |
Resolves and updates URL values starting with '~/' (relative to the application's 'webroot' setting) for
|
TryResolveUrl(String, IHtmlContent) |
Tries to resolve the given |
TryResolveUrl(String, String) |
Tries to resolve the given |