menu

ASP.NET Core - EJ2

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class ButtonBuilder - API Reference

    Show / Hide Table of Contents

    Class ButtonBuilder

    Inheritance
    System.Object
    ControlBuilder
    ButtonBuilder
    Inherited Members
    ControlBuilder.Context
    Namespace: Syncfusion.EJ2.Buttons
    Assembly: Syncfusion.EJ2.dll
    Syntax
    public class ButtonBuilder : ControlBuilder

    Constructors

    ButtonBuilder()

    Declaration
    public ButtonBuilder()

    ButtonBuilder(Button)

    Declaration
    public ButtonBuilder(Button model)
    Parameters
    Type Name Description
    Button model

    Fields

    model

    Declaration
    public Button model
    Field Value
    Type Description
    Button

    Properties

    HtmlAttr

    Declaration
    public IDictionary<string, object> HtmlAttr { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.IDictionary<System.String, System.Object>

    ID

    Declaration
    public string ID { get; set; }
    Property Value
    Type Description
    System.String

    Output

    Declaration
    public override TextWriter Output { get; set; }
    Property Value
    Type Description
    System.IO.TextWriter
    Overrides
    ControlBuilder.Output

    Methods

    Click(String)

    Allows Click Event accepts string value.

    Declaration
    public ButtonBuilder Click(string onClick)
    Parameters
    Type Name Description
    System.String onClick
    Returns
    Type Description
    ButtonBuilder

    Content(String)

    Defines the text content of the Button element. {% codeBlock src='button/content/index.md' %}{% endcodeBlock %}

    Declaration
    public ButtonBuilder Content(string content)
    Parameters
    Type Name Description
    System.String content
    Returns
    Type Description
    ButtonBuilder

    ContentTemplate(Action<Object>)

    Declaration
    public ButtonBuilder ContentTemplate(Action<object> template)
    Parameters
    Type Name Description
    System.Action<System.Object> template
    Returns
    Type Description
    ButtonBuilder

    ContentTemplate(Func<Object, Object>)

    Declaration
    public ButtonBuilder ContentTemplate(Func<object, object> template)
    Parameters
    Type Name Description
    System.Func<System.Object, System.Object> template
    Returns
    Type Description
    ButtonBuilder

    Created(String)

    Triggers once the component rendering is completed.

    Declaration
    public ButtonBuilder Created(string created)
    Parameters
    Type Name Description
    System.String created
    Returns
    Type Description
    ButtonBuilder

    CssClass(String)

    Defines class/multiple classes separated by a space in the Button element. The Button types, styles, and size can be defined by using this. {% codeBlock src='button/cssClass/index.md' %}{% endcodeBlock %}

    Declaration
    public ButtonBuilder CssClass(string cssClass)
    Parameters
    Type Name Description
    System.String cssClass
    Returns
    Type Description
    ButtonBuilder

    Disabled(Boolean)

    Specifies a value that indicates whether the Button is disabled or not.

    Declaration
    public ButtonBuilder Disabled(bool disabled = true)
    Parameters
    Type Name Description
    System.Boolean disabled
    Returns
    Type Description
    ButtonBuilder

    EnableHtmlSanitizer(Boolean)

    Defines whether to allow the cross-scripting site or not.

    Declaration
    public ButtonBuilder EnableHtmlSanitizer(bool enableHtmlSanitizer = true)
    Parameters
    Type Name Description
    System.Boolean enableHtmlSanitizer
    Returns
    Type Description
    ButtonBuilder

    EnablePersistence(Boolean)

    Enable or disable persisting component's state between page reloads.

    Declaration
    public ButtonBuilder EnablePersistence(bool enablePersistence = true)
    Parameters
    Type Name Description
    System.Boolean enablePersistence
    Returns
    Type Description
    ButtonBuilder

    EnableRtl(Boolean)

    Enable or disable rendering component in right to left direction.

    Declaration
    public ButtonBuilder EnableRtl(bool enableRtl = true)
    Parameters
    Type Name Description
    System.Boolean enableRtl
    Returns
    Type Description
    ButtonBuilder

    HtmlAttributes(IDictionary<String, Object>)

    Allows additional HTML attributes such as title, name, etc., and accepts n number of attributes in a key-value pair format.

    Declaration
    public ButtonBuilder HtmlAttributes(IDictionary<string, object> htmlAttributes)
    Parameters
    Type Name Description
    System.Collections.Generic.IDictionary<System.String, System.Object> htmlAttributes
    Returns
    Type Description
    ButtonBuilder

    HtmlAttributes(Object)

    Allows additional HTML attributes such as title, name, etc., and accepts n number of attributes in a key-value pair format.

    Declaration
    public ButtonBuilder HtmlAttributes(object htmlAttributes)
    Parameters
    Type Name Description
    System.Object htmlAttributes
    Returns
    Type Description
    ButtonBuilder

    IconCss(String)

    Defines class/multiple classes separated by a space for the Button that is used to include an icon. Buttons can also include font icon and sprite image.

    Declaration
    public ButtonBuilder IconCss(string iconCss)
    Parameters
    Type Name Description
    System.String iconCss
    Returns
    Type Description
    ButtonBuilder

    IconPosition(IconPosition)

    Positions the icon before/after the text content in the Button. The possible values are: Left: The icon will be positioned to the left of the text content. Right: The icon will be positioned to the right of the text content.

    Declaration
    public ButtonBuilder IconPosition(IconPosition iconPosition)
    Parameters
    Type Name Description
    IconPosition iconPosition
    Returns
    Type Description
    ButtonBuilder

    IsPrimary(Boolean)

    Allows the appearance of the Button to be enhanced and visually appealing when set to true.

    Declaration
    public ButtonBuilder IsPrimary(bool isPrimary = true)
    Parameters
    Type Name Description
    System.Boolean isPrimary
    Returns
    Type Description
    ButtonBuilder

    IsToggle(Boolean)

    Makes the Button toggle, when set to true. When you click it, the state changes from normal to active.

    Declaration
    public ButtonBuilder IsToggle(bool isToggle = true)
    Parameters
    Type Name Description
    System.Boolean isToggle
    Returns
    Type Description
    ButtonBuilder

    Render()

    Declaration
    public HtmlString Render()
    Returns
    Type Description
    Microsoft.AspNetCore.Html.HtmlString

    Type(String)

    Allows Type Property accepts string value

    Declaration
    public ButtonBuilder Type(string type)
    Parameters
    Type Name Description
    System.String type
    Returns
    Type Description
    ButtonBuilder
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved