Table of Contents

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

string

ButtonText

Gets or sets the text of the submit button. The default is "OK".

[HtmlAttributeName("button-text")]
public string ButtonText { get; set; }

Property Value

string

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

Func<CultureInfo, string>

SelectClass

Gets or sets the class of the select element.

[HtmlAttributeName("select-class")]
public string? SelectClass { get; set; }

Property Value

string

ViewContext

Gets or sets the context of the view; set by Razor.

[ViewContext]
[HtmlAttributeNotBound]
public ViewContext ViewContext { get; set; }

Property Value

ViewContext

Methods

Process(TagHelperContext, TagHelperOutput)

Synchronously executes the TagHelper with the given context and output.

public override void Process(TagHelperContext context, TagHelperOutput output)

Parameters

context TagHelperContext

Contains information associated with the current HTML tag.

output TagHelperOutput

A stateful HTML element used to generate an HTML tag.