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
-
CacheBustingTagHelper<TOptions>ImageTagHelper<TOptions>
- Implements
-
IConfigurable<TOptions>
- Derived
- Inherited Members
Constructors
ImageTagHelper(IOptions<TOptions>, ICacheBusting)
Initializes a new instance of the ImageTagHelper<TOptions> class.
protected ImageTagHelper(IOptions<TOptions> setup, ICacheBusting cacheBusting = null)
Parameters
setupIOptions<TOptions>The
TOptionswhich need to be configured.cacheBustingICacheBustingAn 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
contextTagHelperContextContains information associated with the current HTML tag.
outputTagHelperOutputA stateful HTML element used to generate an HTML tag.
Returns
- Task
A Task that on completion updates the
output.