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

RadButton control provides the features, that ASP.NET: Button, ImageButton, LinkButton, RadioButton and CheckBox controls have.

You can find information on the server API of RadButton at the Server-Side Programming Overview article here: .

Definition

Namespace:Telerik.Web.UI

Assembly:Telerik.Web.UI.dll

Syntax:

C#
[RequiredScript(typeof(jQueryPlugins))]
[RequiredScript(typeof(MaterialRipple))]
[ClientScriptResource("Telerik.Web.UI.RadButton", "Telerik.Web.UI.Button.RadButtonScripts.js")]
[EmbeddedSkin("Button")]
[EmbeddedSkin("Button", "Default")]
[RequiredCss("Telerik.Web.UI.Skins.Common.fonticons.css", RenderMode.Lightweight, typeof(RadButton))]
[RequiredCss("Telerik.Web.UI.Skins.Common.MaterialRipple.css", RenderMode.Lightweight, typeof(RadButton))]
[TelerikToolboxCategory("Navigation")]
[ToolboxBitmap(typeof(RadButton), "Toolbox.Icons.Button.png")]
public class RadButton : RadWebControl, IComponent, IDisposable, IParserAccessor, IUrlResolutionService, IDataBindingsAccessor, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor, IAttributeAccessor, IScriptControl, IControlResolver, IPostBackDataHandler, ISkinnableControl, IControl, IButtonControl, IPostBackEventHandler, ICheckBoxControl, INamingContainer

Inheritance: objectControlWebControlRadWebControlRadButton

Implements: IAttributeAccessorIButtonControlICheckBoxControlIComponentIControlIControlBuilderAccessorIControlDesignerAccessorIControlResolverIDataBindingsAccessorIDisposableIExpressionsAccessorINamingContainerIParserAccessorIPostBackDataHandlerIPostBackEventHandlerIScriptControlISkinnableControlIUrlResolutionService...

Inherited Members WebControl.ApplyStyle(Style)WebControl.CopyBaseAttributes(WebControl)WebControl.CreateControlStyle()WebControl.LoadViewState(object)WebControl.TrackViewState()WebControl.MergeStyle(Style)WebControl.RenderBeginTag(HtmlTextWriter)WebControl.RenderEndTag(HtmlTextWriter)WebControl.RenderContents(HtmlTextWriter)WebControl.SaveViewState()WebControl.AttributesWebControl.BackColorWebControl.BorderColorWebControl.BorderWidthWebControl.BorderStyleWebControl.ControlStyleWebControl.ControlStyleCreatedWebControl.DisabledCssClassWebControl.StyleWebControl.EnabledWebControl.EnableThemingWebControl.FontWebControl.ForeColorWebControl.HasAttributesWebControl.IsEnabledWebControl.SupportsDisabledAttributeWebControl.SkinIDWebControl.TabIndexWebControl.TagKeyWebControl.TagNameControl.ResolveAdapter()Control.HasEvents()Control.GetRouteUrl(object)Control.GetRouteUrl(string, object)Control.GetRouteUrl(RouteValueDictionary)Control.GetRouteUrl(string, RouteValueDictionary)Control.GetUniqueIDRelativeTo(Control)Control.ApplyStyleSheetSkin(Page)Control.OnDataBinding(EventArgs)Control.DataBind()Control.DataBind(bool)Control.DataBindChildren()Control.AddParsedSubObject(object)Control.EnsureID()Control.OnInit(EventArgs)Control.ClearChildState()Control.ClearChildControlState()Control.ClearChildViewState()Control.ClearEffectiveClientIDMode()Control.ClearCachedClientID()Control.Focus()Control.LoadControlState(object)Control.MapPathSecure(string)Control.OpenFile(string)Control.OnLoad(EventArgs)Control.OnPreRender(EventArgs)Control.BuildProfileTree(string, bool)Control.SaveControlState()Control.RenderChildren(HtmlTextWriter)Control.RenderControl(HtmlTextWriter)Control.RenderControl(HtmlTextWriter, ControlAdapter)Control.OnUnload(EventArgs)Control.Dispose()Control.RaiseBubbleEvent(object, EventArgs)Control.OnBubbleEvent(object, EventArgs)Control.AddedControl(Control, int)Control.CreateControlCollection()Control.CreateChildControls()Control.ResolveUrl(string)Control.ResolveClientUrl(string)Control.FindControl(string)Control.FindControl(string, int)Control.GetDesignModeState()Control.HasControls()Control.IsLiteralContent()Control.EnsureChildControls()Control.RemovedControl(Control)Control.SetDesignModeState(IDictionary)Control.SetRenderMethodDelegate(RenderMethod)Control.ClientIDModeControl.ClientIDControl.ClientIDSeparatorControl.ContextControl.AdapterControl.DesignModeControl.EventsControl.IDControl.IsChildControlStateClearedControl.EnableViewStateControl.ViewStateModeControl.IsViewStateEnabledControl.NamingContainerControl.IdSeparatorControl.LoadViewStateByIDControl.PageControl.RenderingCompatibilityControl.TemplateControlControl.ParentControl.TemplateSourceDirectoryControl.AppRelativeTemplateSourceDirectoryControl.SiteControl.VisibleControl.UniqueIDControl.HasChildViewStateControl.ControlsControl.ValidateRequestModeControl.ViewStateControl.ViewStateIgnoresCaseControl.ChildControlsCreatedControl.IsTrackingViewStateControl.DisposedControl.DataBindingControl.InitControl.LoadControl.PreRenderControl.Unloadobject.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()object.GetType()object.MemberwiseClone()...

Constructors

C#
public RadButton()

Properties

Gets or sets the accessKey of the RadButton control.

C#
public override string AccessKey { get; set; }

Overrides: RadWebControl.AccessKey

Gets or sets a bool value indicating whether the RadButton control automatically posts back to the server when clicked.

C#
[Themeable(false)]
[ClientControlProperty]
[ClientPropertyName("autoPostBack")]
public virtual bool AutoPostBack { get; set; }

Gets or sets the type of the button. RadButtonType:StandardButton(default), LinkButton and ToggleButton.

C#
[Themeable(false)]
[ClientControlProperty]
public virtual RadButtonType ButtonType { get; set; }

Gets or sets a value indicating whether validation is performed when the RadButton control is clicked.

C#
[Themeable(false)]
[ClientControlProperty]
[ClientPropertyName("_causesValidation")]
public virtual bool CausesValidation { get; set; }

Implements: IButtonControl.CausesValidation

Gets or sets a bool value indicating whether the RadButton control is checked.

C#
[Bindable(true, BindingDirection.TwoWay)]
[Themeable(false)]
[ClientControlProperty]
[ClientPropertyName("checked")]
public virtual bool Checked { get; set; }

Implements: ICheckBoxControl.Checked

Gets or sets an optional parameter passed to the Command event along with the associated CommandName.

C#
[Bindable(true)]
[Themeable(false)]
[ClientControlProperty]
[ClientPropertyName("commandArgument")]
public string CommandArgument { get; set; }

Implements: IButtonControl.CommandArgument

Gets or sets the command name associated with the RadButton control that is passed to the Command event.

C#
[Themeable(false)]
[ClientControlProperty]
[ClientPropertyName("commandName")]
public string CommandName { get; set; }

Implements: IButtonControl.CommandName

Gets the object that controls the built-in confirmation dialog properties.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public RadButtonConfirmSettings ConfirmSettings { get; }

Gets or sets the template for the RadButton control.

C#
[TemplateContainer(typeof(RadButton))]
[PersistenceMode(PersistenceMode.InnerProperty)]
public ITemplate ContentTemplate { get; set; }
Property Value:

An object implementing the ITemplate interface. The default value is a null reference (Nothing in Visual Basic), which indicates that this property is not set.

Gets or sets the CSS class rendered by the RadButton control on the client.

C#
[ClientControlProperty]
[ClientPropertyName("cssClass")]
public override string CssClass { get; set; }

Overrides: RadWebControl.CssClass

Gets or sets the CSS class applied to the RadButton control when it is in a disabled state.

C#
[ClientControlProperty]
[ClientPropertyName("disabledCssClass")]
public virtual string DisabledButtonCssClass { get; set; }

When set to true enables support for WAI-ARIA

C#
[ClientControlProperty]
[ClientPropertyName("enableAriaSupport")]
public bool EnableAriaSupport { get; set; }

Gets or sets a bool value indicating whether the client browser's default styling will be applied to the RadButton control.

When this property is set to true, the control will look like standard HTML input of type="button" or type="submit", with the default styles applied by the client browser.

Use this property when ButtonType="StandardButton".
C#
public virtual bool EnableBrowserButtonStyle { get; set; }

Gets or sets a bool value indicating whether an additional button (besides the primary button) will be rendered in the RadButton control.

C#
[ClientControlProperty]
[ClientPropertyName("enableSplitButton")]
public virtual bool EnableSplitButton { get; set; }

Gets or sets the name of the group the RadButton control, configured as a radio button (ToggleType='Radio'), belongs to.

C#
[Themeable(false)]
[ClientControlProperty]
[ClientPropertyName("groupName")]
public virtual string GroupName { get; set; }

Gets or sets the height of the RadButton control.

C#
[ClientControlProperty]
[ClientPropertyName("height")]
public override Unit Height { get; set; }

Overrides: RadWebControl.Height

Gets or sets the CSS class applied to the RadButton control when the mouse pointer is over the control.

C#
[ClientControlProperty]
[ClientPropertyName("hoveredCssClass")]
public virtual string HoveredCssClass { get; set; }

Gets the object that controls the Primary and Secondary Icon related properties.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public RadButtonIcon Icon { get; }

Gets the object that control the Image properties. A RadButton control can be rendered as an ImageButton, or it can have a BackgroundImage.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public RadButtonImage Image { get; }

Gets or sets the URL to link to when the RadButton control is clicked.

C#
[Bindable(true)]
[ClientControlProperty]
[ClientPropertyName("_navigateUrl")]
public string NavigateUrl { get; set; }

Gets or sets the name of the JavaScript function that will be called after the Checked property of the RadButton control is changed.

C#
[ClientControlEvent]
[ClientPropertyName("checkedChanged")]
public string OnClientCheckedChanged { get; set; }

Gets or sets the name of the JavaScript function that will be called when the Checked property of the RadButton control is about to be changed.

C#
[ClientControlEvent]
[ClientPropertyName("checkedChanging")]
public string OnClientCheckedChanging { get; set; }

Gets or sets the name of the JavaScript function that will be called when the RadButton is clicked, after the OnClientClicking event.

C#
[ClientControlEvent]
[ClientPropertyName("clicked")]
public string OnClientClicked { get; set; }

Gets or sets the name of the JavaScript function that will be called when the RadButton is clicked. The event is cancelable.

C#
[ClientControlEvent]
[ClientPropertyName("clicking")]
public string OnClientClicking { get; set; }

Gets or sets the name of the JavaScript function that will be called when the RadButton is loaded on the page.

C#
[ClientControlEvent]
[ClientPropertyName("load")]
public string OnClientLoad { get; set; }

Gets or sets the name of the JavaScript function that will be called when the mouse pointer leaves the RadButton.

C#
[ClientControlEvent]
[ClientPropertyName("mouseOut")]
public string OnClientMouseOut { get; set; }

Gets or sets the name of the JavaScript function that will be called when the mouse pointer hovers over the RadButton.

C#
[ClientControlEvent]
[ClientPropertyName("mouseOver")]
public string OnClientMouseOver { get; set; }

Gets or sets the name of the JavaScript function that will be called after the SelectedToggleStateIndex property of the RadButton control is changed.

C#
[ClientControlEvent]
[ClientPropertyName("toggleStateChanged")]
public string OnClientToggleStateChanged { get; set; }

Gets or sets the name of the JavaScript function that will be called when the SelectedToggleStateIndex property of the RadButton control is about to be changed.

C#
[ClientControlEvent]
[ClientPropertyName("toggleStateChanging")]
public string OnClientToggleStateChanging { get; set; }

Gets or sets the URL of the page to post to from the current page when the RadButton control is clicked.

C#
[Themeable(false)]
public string PostBackUrl { get; set; }

Implements: IButtonControl.PostBackUrl

Gets or sets the CSS class applied to the RadButton control when the control is pressed.

C#
[ClientControlProperty]
[ClientPropertyName("pressedCssClass")]
public virtual string PressedCssClass { get; set; }

Gets/Sets the primary appearance of the button.

C#
[ClientControlProperty]
[ClientPropertyName("primary")]
public bool Primary { get; set; }

Gets or sets a bool value indicating whether the RadButton control is in a read-only mode.

C#
[Themeable(false)]
[ClientControlProperty]
[ClientPropertyName("readOnly")]
public bool ReadOnly { get; set; }

Gets or sets the CSS class applied to the RadButton control when it is in ReadOnly mode. The ReadOnly property is set to true.

C#
[ClientControlProperty]
[ClientPropertyName("readOnlyCssClass")]
public virtual string ReadOnlyCssClass { get; set; }

Gets the currently selected ToggleState of the RadButton control when used as a custom toggle button.

C#
[Browsable(false)]
[Bindable(false)]
[Themeable(false)]
public virtual RadButtonToggleState SelectedToggleState { get; }

Gets or sets the index of the currently selected ToggleState of the RadButton control, when used as a custom toggle button.

C#
[Browsable(false)]
[Bindable(false)]
[Themeable(false)]
[ClientControlProperty]
[ClientPropertyName("selectedToggleStateIndex")]
public virtual int SelectedToggleStateIndex { get; set; }

Gets or sets a bool value indicating whether the RadButton control will be immediately disabled after the user has clicks it. (i.e. enables/disables "Single Click" functionality)

C#
[Themeable(false)]
[ClientControlProperty]
[ClientPropertyName("singleClick")]
public virtual bool SingleClick { get; set; }

Gets or sets the text displayed in the RadButton control after the button is being clicked and disabled. (i.e. the text used for the 'Single Click' functionality)

C#
[Bindable(true)]
[ClientControlProperty]
[ClientPropertyName("singleClickText")]
public string SingleClickText { get; set; }

Gets or sets the CSS class applied to the SplitButton of the RadButton control.

C#
public virtual string SplitButtonCssClass { get; set; }

Gets or sets the position (relative to the RadButton's text) of the split button.

C#
public virtual ButtonPosition SplitButtonPosition { get; set; }

Gets or sets the target window or frame in which to display the Web page content linked to when the RadButton control is clicked.

C#
[TypeConverter(typeof(TargetConverter))]
[ClientControlProperty]
[ClientPropertyName("target")]
public string Target { get; set; }

Gets or sets the text displayed in the RadButton control.

C#
[Bindable(true)]
[ClientControlProperty]
[ClientPropertyName("text")]
public string Text { get; set; }

Implements: IButtonControl.Text

Gets a collection of RadButtonToggleState objects that belong to the RadButton control.

C#
[Themeable(false)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public RadButtonToggleStateCollection ToggleStates { get; }

Gets or sets the toggle type of the RadButton control when used as a toggle button. The Default is ButtonToggleType='None'.

C#
[Themeable(false)]
[ClientControlProperty]
public virtual ButtonToggleType ToggleType { get; set; }

Gets or sets the text that will be displayed in the tooltip of the RadButton control when it is hovered.

C#
[ClientControlProperty]
[ClientPropertyName("toolTip")]
public override string ToolTip { get; set; }

Overrides: RadWebControl.ToolTip

Gets or sets a value indicating whether the RadButton control uses the client browser's submit mechanism or the ASP.NET postback mechanism.

C#
[Themeable(false)]
public virtual bool UseSubmitBehavior { get; set; }

Gets or sets the group of controls for which the RadButton control causes validation when it posts back to the server.

C#
[Themeable(false)]
[ClientControlProperty]
[ClientPropertyName("_validationGroup")]
public virtual string ValidationGroup { get; set; }

Implements: IButtonControl.ValidationGroup

Gets or sets an optional Value of the RadButton control.

C#
[ClientControlProperty]
[ClientPropertyName("value")]
public string Value { get; set; }

Gets or sets the width of the RadButton control.

C#
[ClientControlProperty]
[ClientPropertyName("width")]
public override Unit Width { get; set; }

Overrides: RadWebControl.Width

Methods

Adds the attributes of the RadButton control to the output stream for rendering on the client.

C#
protected override void AddAttributesToRender(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter

An HtmlTextWriter that contains the output stream to render on the client.

Overrides: RadWebControl.AddAttributesToRender(HtmlTextWriter)

Clears out the list selection and sets the Selected property of all ToggleState objects to false.

C#
public virtual void ClearSelection()

Find a RadButton's ToggleState by the value of its Text property

C#
public virtual RadButtonToggleState FindToggleStateByText(string text)
Parameters:textstring

Text of the ToggleState

Returns:

RadButtonToggleState

Find a RadButton's ToggleState by the value of its Value property

C#
public virtual RadButtonToggleState FindToggleStateByValue(string value)
Parameters:valuestring

Value of the ToggleState

Returns:

RadButtonToggleState

Creates a PostBackOptions object that represents the RadButton control's postback behavior, and returns the client script generated as a result of the PostBackOptions.

C#
protected virtual string GetPostbackEventReference()
Returns:

string

The client script that represents the RadButton control's PostBackOptions.

Raises the CheckedChanged event of the RadButton control.

C#
protected virtual void OnCheckedChanged(EventArgs e)
Parameters:eEventArgs

Raises the Click event of the RadButton control.

C#
protected virtual void OnClick(ButtonClickEventArgs e)
Parameters:eButtonClickEventArgs

A ButtonClickEventArgs that contains the event data.

Raises the Command event of the RadButton control.

C#
protected virtual void OnCommand(ButtonCommandEventArgs e)
Parameters:eButtonCommandEventArgs

A ButtonCommandEventArgs that contains the event data.

Raises the ToggleStateChaned event of the RadButton control.

C#
protected virtual void OnToggleStateChanged(ButtonToggleStateChangedEventArgs e)
Parameters:eButtonToggleStateChangedEventArgs

Raises events for the RadButton control when it posts back to the server.

C#
protected virtual void RaisePostBackEvent(string eventArgument)
Parameters:eventArgumentstring

The argument for the event.

Invokes the OnCheckedChanged and OnToggleStateChanged methods, when the Checked and SelectedToggleStateIndex properties of the RadButton control have changed.

C#
protected override void RaisePostDataChangedEvent()

Overrides: RadWebControl.RaisePostDataChangedEvent()

C#
protected override void Render(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter

Overrides: RadWebControl.Render(HtmlTextWriter)

Sets the selected state by provided value.

If multiple ToggleStates have equal value the first one will be selected.

If ToggleState with the provided value is not registered the current ToggleState will not be changed.

C#
public virtual void SetSelectedToggleStateByText(string text)
Parameters:textstring

Text of the ToggleState to be selected

Sets the selected state by provided value.

If multiple ToggleStates have equal value the first one will be selected.

If ToggleState with the provided value is not registered the current ToggleState will not be changed.

C#
public virtual void SetSelectedToggleStateByValue(string value)
Parameters:valuestring

Value of the ToggleState to be selected

Events

Adds or removes an event handler method from the CheckedChanged event. The event is fired when the value of the Checked property changes between posts to the server.

C#
public event EventHandler CheckedChanged

Implements: ICheckBoxControl.CheckedChanged

Adds or removes an event handler method from the Click event. The event is fired when the RadButton control is clicked.

C#
public event EventHandler Click

Implements: IButtonControl.Click

Adds or removes an event handler method from the Command event. The event is fired when the RadButton control is clicked.

C#
public event CommandEventHandler Command

Implements: IButtonControl.Command

Adds or removes an event handler method from the ToggleStateChanged event. The event is fired when the value of the SelectedToggleStateIndex property changes between posts to the server. Valid only when RadButton has ToggleType set with value, different than None

C#
public event ButtonToggleStateChangedEventHandler ToggleStateChanged