Class TlumachCultureSelectorTagHelper
- Namespace
- Tlumach.AspNetCore.Mvc
- Assembly
- Tlumach.AspNetCore.Mvc.dll
Lets the user choose one of SupportedCultures: a form that sends the choice to the culture endpoint
(MapTlumachCultureEndpoint), which stores it in the culture cookie and returns to the current page. No script is used; add one that submits the form
on change if the button is not wanted. Nothing is rendered when no cultures are supported.
[HtmlTargetElement("tlumach-culture-selector", TagStructure = TagStructure.WithoutEndTag)]
public sealed class TlumachCultureSelectorTagHelper : TagHelper, ITagHelper, ITagHelperComponent
- Inheritance
-
TlumachCultureSelectorTagHelper
- Implements
- Inherited Members
Properties
ButtonClass
Gets or sets the class of the submit button.
[HtmlAttributeName("button-class")]
public string? ButtonClass { get; set; }
Property Value
ButtonText
Gets or sets the text of the submit button. The default is "OK".
[HtmlAttributeName("button-text")]
public string ButtonText { get; set; }
Property Value
DisplayName
Gets or sets the function that returns the text of a culture. The default is NativeName.
[HtmlAttributeName("display-name")]
public Func<CultureInfo, string>? DisplayName { get; set; }
Property Value
SelectClass
Gets or sets the class of the select element.
[HtmlAttributeName("select-class")]
public string? SelectClass { get; set; }
Property Value
ViewContext
Gets or sets the context of the view; set by Razor.
[ViewContext]
[HtmlAttributeNotBound]
public ViewContext ViewContext { get; set; }
Property Value
Methods
Process(TagHelperContext, TagHelperOutput)
Synchronously executes the TagHelper with the given context and
output.
public override void Process(TagHelperContext context, TagHelperOutput output)
Parameters
contextTagHelperContextContains information associated with the current HTML tag.
outputTagHelperOutputA stateful HTML element used to generate an HTML tag.