New to Telerik UI for ASP.NET Core? Start a free 30-day trial

Button

Class

Kendo UI Button component

Definition

Constructors

Initializes a new instance of the Button class.

C#
public Button(ViewContext viewContext)
Parameters:viewContextViewContext

Properties

If set to true a default overlay badge will be displayed. If set to a string, an ovelay with content set to the specified string will be displayed. Can be set to a JavaScript object which represents the configuration of the Badge widget.

C#
public ButtonBadgeSettings Badge { get; }

Content member.

C#
public Func<object, object> Content { get; set; }

ContentAction member.

C#
public Action ContentAction { get; set; }

Indicates whether the Button should be enabled or disabled. By default, it is enabled, unless a disabled="disabled" attribute is detected.

C#
public bool? Enable { get; set; }

Defines a Kendo UI font or SVG icon that is rendered after the Button text.

C#
public string EndIcon { get; set; }

Sets a value controlling how the color is applied.

C#
public ButtonFillMode? FillMode { get; set; }

Html member.

C#
public string Html { get; set; }
C#
public string Icon { get; set; }

Defines a CSS class - or multiple classes separated by spaced - which are applied to a span element inside the Button. Allows the usage of custom icons.

C#
public string IconClass { get; set; }

Defines a name of an existing icon in the Kendo UI theme sprite. The icon will be applied as background image of a span element inside the Button. The span element can be added automatically by the widget, or an existing element can be used, if it has a k-icon CSS class applied. For a list of available icon names, please refer to the Icon Button article.Set this option to an icon descriptor such as { name: "gear", variant: "outline" }. The variant can be outline, solid, or duotone; it applies to SVG rendering and is ignored for font icons.

C#
public ButtonIconSettings IconSettings { get; }

Defines a URL, which will be used for an img element inside the Button. The URL can be relative or absolute. In case it is relative, it will be evaluated with relation to the web page URL.The img element can be added automatically by the widget, or an existing element can be used, if it has a k-image CSS class applied.

C#
public string ImageUrl { get; set; }

Sets a value controlling the border radius.

C#
public Rounded? Rounded { get; set; }

Controls the overall physical size of a button. Valid values are: "xsmall", "small", "medium", and "large". When undefined (the default), the theme controls the default size.The "none" value is deprecated. Use custom CSS to customize the size.

C#
public ButtonSize? Size { get; set; }

Defines a CSS class (or multiple classes separated by spaces), which will be used for applying a background image to a span element inside the Button. In case you want to use an icon from the Kendo UI theme sprite background image, it is easier to use the icon property.The span element can be added automatically by the widget, or an existing element can be used, if it has a k-sprite CSS class applied.

C#
public string SpriteCssClass { get; set; }

Tag member.

C#
public string Tag { get; set; }

Sets the color of the component according to the applied theme.

C#
public ThemeColor? ThemeColor { get; set; }

Methods

Serializes the component settings to a dictionary.

C#
public override IDictionary<string, object> Serialize()
Returns:

IDictionary<string, object>

A dictionary of settings.

Overrides: WidgetBase.Serialize()

SerializeSettings method.

C#
protected override Dictionary<string, object> SerializeSettings()
Returns:

Dictionary<string, object>

Overrides: WidgetBase.SerializeSettings()

Writes the HTML content.

C#
protected override void WriteHtml(TextWriter writer)
Parameters:writerTextWriter

The text writer.

Overrides: WidgetBase.WriteHtml(TextWriter)

WriteInitializationScript method.

C#
public override void WriteInitializationScript(TextWriter writer)
Parameters:writerTextWriter

Overrides: WidgetBase.WriteInitializationScript(TextWriter)