Kendo UI ToggleButton TagHelper ToggleButtonTagHelper class.
Definition
Namespace:Kendo.Mvc.TagHelpers
Assembly:Kendo.Mvc.dll
Syntax:
[HtmlTargetElement("kendo-togglebutton")]
[OutputElementHint("button")]
public class ToggleButtonTagHelper : TagHelperBase, ITagHelper, ITagHelperComponent
Inheritance: objectTagHelperTagHelperBaseToggleButtonTagHelper
Implements:
Inherited Members
Example:
@addTagHelper *, Kendo.Mvc
<kendo-togglebutton name="togglebutton">
<badge text="1" />
</kendo-togglebutton>
Child Tags
Constructors
Initializes a new instance of the ToggleButtonTagHelper class.
public ToggleButtonTagHelper(IKendoHtmlGenerator generator)
Properties
Sets whether the component should be enabled or disabled.
public bool? Enable { get; set; }
Sets a value controlling how the color is applied.
public FillMode? FillMode { get; set; }
Specifies a group of ToggleButtons the current instance belongs to. The string will be rendered as a value of the data-group attribute of the widget's element.
public string Group { get; set; }
Sets the image url for the and img element inside the component.
public string ImageUrl { get; set; }
The name of the JavaScript function that will handle the click event. Fires when the Button is clicked with the mouse, touched on a touch device, or ENTER (or SPACE) is pressed while the Button is focused.
public string OnClick { get; set; }
The name of the JavaScript function that will handle the kendoKeydown event. Triggered when the user presses a keyboard key while the Button is focused.The event handler function context (available via the this keyword) will be set to the widget instance.
public string OnKendoKeydown { get; set; }
The name of the JavaScript function that will handle the toggle event. Fires when the ToggleButton selected state is toggled.
public string OnToggle { get; set; }
Specifies the selected state of the ToggleButtons. If set to true the widget will be initially selected.
public bool? Selected { get; set; }
Sets the size of the component.
public ButtonSize? Size { get; set; }
Sets the CSS class, which will be used for applying a background image to a span element inside the component.
public string SpriteCssClass { get; set; }
Sets the HTML tag to be rendered by the Button. Renders a button tag by default.
public string Tag { get; set; }
Sets the color of the component according to the applied theme.
public ThemeColor? ThemeColor { get; set; }
Methods
Gets the initialization script.
protected override string GetInitializationScript()
The initialization script.
Overrides:
public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
Overrides:
Serializes the defined settings.
public override IDictionary<string, object> Serialize()
Overrides:
SerializeEvents method.
protected override Dictionary<string, object> SerializeEvents()
Overrides:
SerializeSettings method.
protected override Dictionary<string, object> SerializeSettings()
Overrides:
Writes the HTML output.
protected override void WriteHtml(TagHelperOutput output)
The TagHelper output.
Overrides: