Class ToggleButton
Represents the Toggle Button UI element.
Implements
Inherited Members
Namespace: Syncfusion.JavaScript.Web
Assembly: Syncfusion.EJ.Web.dll
Syntax
public class ToggleButton : CommonControl, INamingContainer, IPostBackEventHandler, IPostBackDataHandler, IUrlResolutionService
Constructors
ToggleButton()
Declaration
public ToggleButton()
Properties
ActivePrefixIcon
Gets or sets the primary icon of toggle button when the control is in active(checked) state. This is applicable for the content types image only, image text image, text and image and image both.
Declaration
public string ActivePrefixIcon { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ActiveSuffixIcon
Gets or sets the secondary icon of toggle button when the control is in active(checked) state. This is applicable for the content types imagetextimage and imageboth.
Declaration
public string ActiveSuffixIcon { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ActiveText
Gets or sets the text to be shown in the active(checked) state of the toggle button.
Declaration
public string ActiveText { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ClientSideOnChange
Gets or sets a value indicating this event gets fired when toggle button state is changed successfully.
Declaration
public string ClientSideOnChange { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ClientSideOnClick
Gets or sets a value indicating this event gets fired when toggle button is clicked successfully.
Declaration
public string ClientSideOnClick { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ClientSideOnCreate
Gets or sets a value indicating this event gets fired when toggle button is created successfully.
Declaration
public string ClientSideOnCreate { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ClientSideOnDestroy
Gets or sets a value indicating this event gets fired when toggle button is destroyed successfully.
Declaration
public string ClientSideOnDestroy { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ContentType
Gets or sets the content type of the toggle 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 toggle button for theme customization.
Declaration
public string CssClass { get; set; }
Property Value
Type | Description |
---|---|
System.String |
DefaultPrefixIcon
Gets or sets the primary icon of toggle button when the control is in default(unchecked) state. This is applicable for the content types image only, image text image, text and image and image both.
Declaration
public string DefaultPrefixIcon { get; set; }
Property Value
Type | Description |
---|---|
System.String |
DefaultSuffixIcon
Gets or sets the secondary icon of toggle button when the control is in default(unchecked) state. This is applicable for the content types imagetextimage and imageboth.
Declaration
public string DefaultSuffixIcon { get; set; }
Property Value
Type | Description |
---|---|
System.String |
DefaultText
Gets or sets the text to be shown in the default(unchecked) state of the toggle button.
Declaration
public string DefaultText { 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 |
EnablePersistence
Gets or set the value indicating toggle button model value even after form post back/browser refresh sustains or not.
Declaration
public bool EnablePersistence { 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 toggle button.
Declaration
public string Height { get; set; }
Property Value
Type | Description |
---|---|
System.String |
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 toggle button model object of the toggle button properties.
Declaration
public ToggleButtonProperties Model { get; set; }
Property Value
Type | Description |
---|---|
ToggleButtonProperties |
PreventToggle
Gets or sets a value which prevents the toggling behavior of the control.
Declaration
public bool PreventToggle { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
ShowRoundedCorner
Gets or sets a value indicating whether toggle 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 toggle button. Size can be normal, mini, small, medium or large.
Declaration
public ButtonSize Size { get; set; }
Property Value
Type | Description |
---|---|
ButtonSize |
ToggleState
Gets or sets a value indicating toggle button state to be checked(active) or unchecked(default).
Declaration
public bool ToggleState { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Type
Gets or sets a value indicating whether button type 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 toggle 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
LoadViewState(Object)
Restores view-state information from a previous page request.
Declaration
protected override void LoadViewState(object state)
Parameters
Type | Name | Description |
---|---|---|
System.Object | state |
Overrides
OnPreRender(EventArgs)
Modifying server controls before sending them to the client.
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
Render()
Renders the toggle 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
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
Events
Change
Specifies the server side OnChange event.
Declaration
public event ToggleButton.ToggleButtonEventHandler Change
Event Type
Type | Description |
---|---|
ToggleButton.ToggleButtonEventHandler |
Click
Specifies the server side OnClick event.
Declaration
public event ToggleButton.ToggleButtonEventHandler Click
Event Type
Type | Description |
---|---|
ToggleButton.ToggleButtonEventHandler |