Class ImageTagHelper<TOptions>
- Namespace
- Cuemon.AspNetCore.Razor.TagHelpers
- Assembly
- Cuemon.AspNetCore.Razor.TagHelpers.dll
Provides a base-class for targeting <img> elements that supports ICacheBusting versioning.
public abstract class ImageTagHelper<TOptions> : CacheBustingTagHelper<TOptions>, ITagHelper, ITagHelperComponent, IConfigurable<TOptions> where TOptions : TagHelperOptions, new()
Type Parameters
TOptions
- Inheritance
-
TagHelperCacheBustingTagHelper<TOptions>ImageTagHelper<TOptions>
- Implements
-
ITagHelperITagHelperComponentIConfigurable<TOptions>
- Derived
- Inherited Members
-
TagHelper.Init(TagHelperContext)TagHelper.Process(TagHelperContext, TagHelperOutput)TagHelper.Order
Constructors
ImageTagHelper(IOptions<TOptions>, ICacheBusting)
Initializes a new instance of the ImageTagHelper<TOptions> class.
protected ImageTagHelper(IOptions<TOptions> setup, ICacheBusting cacheBusting = null)
Parameters
setup
IOptions<TOptions>The
TOptions
which need to be configured.cacheBusting
ICacheBustingAn optional object implementing the ICacheBusting interface.
Properties
Alt
Gets or sets the alternative text of the image.
public string Alt { get; set; }
Property Value
- String
The alternative text of the image.
Class
Gets or sets the class name of the image.
public string Class { get; set; }
Property Value
- String
The class name of the image.
Id
Gets or sets the identifier of the image.
public string Id { get; set; }
Property Value
- String
The identifier of the image.
Src
Gets or sets the source of the image.
public string Src { get; set; }
Property Value
- String
The source of the image.
Title
Gets or sets the title of the image.
public string Title { get; set; }
Property Value
- String
The title of the image.
Methods
ProcessAsync(TagHelperContext, TagHelperOutput)
Asynchronously executes the TagHelper with the given context
and output
.
public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
Parameters
context
TagHelperContextContains information associated with the current HTML tag.
output
TagHelperOutputA stateful HTML element used to generate an HTML tag.
Returns
- Task
A Task that on completion updates the
output
.