menu

ASP.NET Web Forms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class Button

    Show / Hide Table of Contents

    Class Button

    Represents the Button UI element.

    Inheritance
    System.Object
    CommonControl
    Button
    Implements
    System.Web.UI.INamingContainer
    System.Web.UI.IPostBackEventHandler
    System.Web.UI.IPostBackDataHandler
    System.Web.UI.IUrlResolutionService
    Inherited Members
    CommonControl.RaisePostBackEvent(String)
    CommonControl.OnInit(EventArgs)
    CommonControl.OnLoad(EventArgs)
    Namespace: Syncfusion.JavaScript.Web
    Assembly: Syncfusion.EJ.Web.dll
    Syntax
    public class Button : CommonControl, INamingContainer, IPostBackEventHandler, IPostBackDataHandler, IUrlResolutionService

    Constructors

    Button()

    Declaration
    public Button()

    Properties

    ClientSideOnClick

    Gets or sets a value indicating this event gets fired when button is clicked.

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

    ClientSideOnCreate

    Gets or sets a value indicating this event gets fired when button is created.

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

    ClientSideOnDestroy

    Gets or sets a value indicating this event gets fired when the button is destroyed.

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

    ContentType

    Gets or sets the content type of the button. Button can have image only, text only, image text image, text and image or image both as content type.

    Declaration
    public ContentType ContentType { get; set; }
    Property Value
    Type Description
    ContentType

    CssClass

    Gets or sets the root CSS class to button for theme customization.

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

    Enabled

    Gets or sets a value indicating whether the control can respond to user interaction.

    Declaration
    public bool Enabled { get; set; }
    Property Value
    Type Description
    System.Boolean

    EnableRTL

    Gets or sets a value indicating whether control's elements supports to align in right to left direction.

    Declaration
    public bool EnableRTL { get; set; }
    Property Value
    Type Description
    System.Boolean

    Height

    Gets or sets the height of the button.

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

    HtmlAttributes

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

    ImagePosition

    Gets or sets a value indicating whether image position is left or right. This property is applicable for the content type 'text and image' only.

    Declaration
    public ImagePosition ImagePosition { get; set; }
    Property Value
    Type Description
    ImagePosition

    Model

    Gets or sets the button model object of the button properties.

    Declaration
    public ButtonProperties Model { get; set; }
    Property Value
    Type Description
    ButtonProperties

    PrefixIcon

    Gets or sets the primary icon for button. This is applicable for the content types image only, image text image, text and image and image both.

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

    RepeatButton

    Gets or sets a value indicating whether button can acts as repeat button. Repeat button raises its ‘click’ event repeatedly from the time it is pressed until it is released.

    Declaration
    public bool RepeatButton { get; set; }
    Property Value
    Type Description
    System.Boolean

    ShowRoundedCorner

    Gets or sets a value indicating whether button with rounded corners or not.

    Declaration
    public bool ShowRoundedCorner { get; set; }
    Property Value
    Type Description
    System.Boolean

    Size

    Gets or sets the size of the button. Size can be normal, mini, small, medium or large.

    Declaration
    public ButtonSize Size { get; set; }
    Property Value
    Type Description
    ButtonSize

    SuffixIcon

    Gets or sets the secondary icon for button. This is applicable for the content types imagetextimage and imageboth.

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

    Text

    Gets or sets the text associated with button.

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

    TimeInterval

    Gets or sets the time interval between two consecutive ‘click’ event on the button. This applicable for button in 'repeat button' mode only.

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

    Type

    Gets or sets a value indicating whether the button is a submit, reset or normal button.

    Declaration
    public ButtonType Type { get; set; }
    Property Value
    Type Description
    ButtonType

    Width

    Gets or sets the width of the button.

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

    Methods

    DependentScripts()

    Specifies the dependent scripts.

    Declaration
    public List<string> DependentScripts()
    Returns
    Type Description
    System.Collections.Generic.List<System.String>

    GetDependentFiles()

    Specifies the the dependent files.

    Declaration
    public override List<string> GetDependentFiles()
    Returns
    Type Description
    System.Collections.Generic.List<System.String>
    Overrides
    CommonControl.GetDependentFiles()

    LoadViewState(Object)

    Declaration
    protected override void LoadViewState(object state)
    Parameters
    Type Name Description
    System.Object state
    Overrides
    CommonControl.LoadViewState(Object)

    OnPreRender(EventArgs)

    Declaration
    protected override void OnPreRender(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    PostBackEventHandler(String, Dictionary<String, Object>)

    Specifies the handler for server side events.

    Declaration
    public override void PostBackEventHandler(string EventName, Dictionary<string, object> args)
    Parameters
    Type Name Description
    System.String EventName
    System.Collections.Generic.Dictionary<System.String, System.Object> args
    Overrides
    CommonControl.PostBackEventHandler(String, Dictionary<String, Object>)

    Render()

    Renders the button instance.

    Declaration
    public string Render()
    Returns
    Type Description
    System.String

    Render(HtmlTextWriter)

    Declaration
    protected override void Render(HtmlTextWriter writer)
    Parameters
    Type Name Description
    System.Web.UI.HtmlTextWriter writer
    Overrides
    CommonControl.Render(HtmlTextWriter)

    UpdateServerModel(Dictionary<String, Object>)

    Updates the server model with client model.

    Declaration
    public override void UpdateServerModel(Dictionary<string, object> ClientModel)
    Parameters
    Type Name Description
    System.Collections.Generic.Dictionary<System.String, System.Object> ClientModel
    Overrides
    CommonControl.UpdateServerModel(Dictionary<String, Object>)

    Events

    Click

    Represents the button click event handler.

    Declaration
    public event Button.ButtonEventHandler Click
    Event Type
    Type Description
    Button.ButtonEventHandler

    Implements

    System.Web.UI.INamingContainer
    System.Web.UI.IPostBackEventHandler
    System.Web.UI.IPostBackDataHandler
    System.Web.UI.IUrlResolutionService
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved