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

Defines the fluent interface for configuring the Buttoncomponent.

Definition

Constructors

Initializes a new instance of the SliderBuilder<T>class.

C#
public ButtonBuilder(Button component)
Parameters:componentButton

The component.

Methods

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 ButtonBuilder Badge(Action<ButtonBadgeSettingsBuilder> configurator)
Parameters:configuratorAction<ButtonBadgeSettingsBuilder>

The configurator for the badge setting.

Returns:

ButtonBuilder

Enables the badge

C#
public ButtonBuilder Badge(bool enabled)
Parameters:enabledbool

Specifies whether the badge is enabled.

Returns:

ButtonBuilder

Sets the value of the badge

C#
public ButtonBuilder Badge(string value)
Parameters:valuestring

The value of the badge.

Returns:

ButtonBuilder

Sets the HTML content of the Button.

C#
public ButtonBuilder Content(Action content)
Parameters:contentAction

The action which renders the HTML content.

Returns:

ButtonBuilder

Example:
C#
@(  Html.Kendo().Button()
.Name("Button1")
.Content(() =&gt; { &gt;%
&lt;p&gt;Content&lt;/p&gt;
%&lt;})
.Render();
)

Sets the HTML content of the Button.

C#
public ButtonBuilder Content(Func<object, object> content)
Parameters:contentFunc<object, object>

The Razor template for the HTML content.

Returns:

ButtonBuilder

Example:
C#
@(Html.Kendo().Button()
.Name("Button1")
.Content(@&lt;p&gt;Content&lt;/p&gt;)
.Render();)

Sets the HTML content of the Button.

C#
public ButtonBuilder Content(string content)
Parameters:contentstring

The HTML content.

Returns:

ButtonBuilder

Example:
C#
@( Html.Kendo().Button()
.Name("Button")
.Content("&lt;p&gt;Content&lt;/p&gt;")
)

Sets whether Button should be enabled.

C#
public ButtonBuilder Enable(bool value)
Parameters:valueboolReturns:

ButtonBuilder

Configures the client-side events.

C#
public ButtonBuilder Events(Action<ButtonEventBuilder> events)
Parameters:eventsAction<ButtonEventBuilder>

The client events action.

Returns:

ButtonBuilder

Example:
C#
@( Html.Kendo().Button()
.Name("Button")
.Events(events =&gt;
events.Click("onClick"))
)

Sets a value controlling how the color is applied.

C#
public ButtonBuilder FillMode(ButtonFillMode? value)
Parameters:valueButtonFillMode?

The value for FillMode

Returns:

ButtonBuilder

Sets the icon name of the Button.

C#
public ButtonBuilder Icon(string icon)
Parameters:iconstringReturns:

ButtonBuilder

Sets the image URL of the Button.

C#
public ButtonBuilder ImageUrl(string url)
Parameters:urlstringReturns:

ButtonBuilder

Sets a value controlling the border radius.

C#
public ButtonBuilder Rounded(Rounded? value)
Parameters:valueRounded?

The value for Rounded

Returns:

ButtonBuilder

Sets the size of the component.

C#
public ButtonBuilder Size(ButtonSize? value)
Parameters:valueButtonSize?

The value for Size

Returns:

ButtonBuilder

Sets the sprite CSS class(es) of the Button.

C#
public ButtonBuilder SpriteCssClass(string cssClass)
Parameters:cssClassstringReturns:

ButtonBuilder

Sets the Button HTML tag. A button tag is used by default.

C#
public ButtonBuilder Tag(string tag)
Parameters:tagstringReturns:

ButtonBuilder

Example:
C#
@( Html.Kendo().Button()
.Name("Button")
.Tag("span")
)

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

C#
public ButtonBuilder ThemeColor(ThemeColor? value)
Parameters:valueThemeColor?

The value for ThemeColor

Returns:

ButtonBuilder