# ButtonBase

Namespace: **Wisej.Web**

Assembly: **Wisej.Framework** (4.0.0.0)

* [Control](/api/wisej.web/general/control.md)
  * [ButtonBase](/api/wisej.web/buttons/wisej.web.buttonbase.md)

Implements the basic functionality common to button controls.

{% tabs %}
{% tab title="C#" %}

```csharp
public class ButtonBase : Control, IImage, ICommandSource
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class ButtonBase
    Inherits Control
    Implements IImage, ICommandSource
```

{% endtab %}
{% endtabs %}

## Constructors

### ![](/files/hsR4ok3152WyAf8J2C1u) ButtonBase()

Initializes a new instance of the [ButtonBase](/api/wisej.web/buttons/wisej.web.buttonbase.md) class.

## Properties

### ![](/files/hsR4ok3152WyAf8J2C1u) AllowHtml

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets a value indicating that the control can display HTML in the Text property. (Default: `False`)

Newlines (CRLF) are converted to \<BR/> when [AllowHtml](#allowhtml) is false, or when [AllowHtml](#allowhtml) is true and the text doesn't contain any HTML.

### ![](/files/hsR4ok3152WyAf8J2C1u) AllowMarkdown

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets a value indicating that the control can display markdown text as HTML in the Text property. (Default: `False`)

### ![](/files/hsR4ok3152WyAf8J2C1u) AutoEllipsis

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the ellipsis character (...) appears at the right edge of the button, denoting that the text extends beyond the size of the button. (Default: `False`)

### ![](/files/hsR4ok3152WyAf8J2C1u) AutoShowLoader

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the application blocks the browser with a modal mask when this button is clicked and until the server is done processing the execution request. (Default: `False`)

[AutoShowLoader](#autoshowloader) blocks the entire browser as soon as the button is clicked since it's implemented on the client side, while [ShowLoader](/api/wisej.web/general/control.md#showloader) blocks the specific widget when returning from the request.

### ![](/files/hsR4ok3152WyAf8J2C1u) AutoSize

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets a value that indicates whether the control resizes based on its contents. (Default: `False`)

### ![](/files/hsR4ok3152WyAf8J2C1u) CharacterCasing

[CharacterCasing](/api/wisej.web/editors/wisej.web.charactercasing.md): Returns or sets the case of the text to display to the user. (Default: `Normal`)

### ![](/files/hsR4ok3152WyAf8J2C1u) Command

[ICommand](/api/wisej.web/interfaces/wisej.web.icommand.md): Returns or sets the [ICommand](/api/wisej.web/interfaces/wisej.web.icommand.md) implementation to invoke. (Default: `null`)

### ![](/files/lzopMboA31bVq8UIcbT3) DefaultSize

[Size](https://docs.microsoft.com/dotnet/api/system.drawing.size):

### ![](/files/hsR4ok3152WyAf8J2C1u) Image

[Image](https://docs.microsoft.com/dotnet/api/system.drawing.image): Returns or sets the image that is displayed in a button control.

### ![](/files/hsR4ok3152WyAf8J2C1u) ImageAlign

[ContentAlignment](https://docs.microsoft.com/dotnet/api/system.drawing.contentalignment): Returns or sets the alignment of the image in the button control. (Default: `MiddleCenter`)

### ![](/files/hsR4ok3152WyAf8J2C1u) ImageIndex

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns or sets the image list index value of the image in the [ImageList](#imagelist) displayed in the button control. (Default: `-1`)

**Throws:**

* [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception)\
  The specified index is less than -1.

### ![](/files/hsR4ok3152WyAf8J2C1u) ImageKey

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets the key accessor for the image in the [ImageList](#imagelist) displayed in the button control. (Default: `""`)

### ![](/files/hsR4ok3152WyAf8J2C1u) ImageList

[ImageList](/api/wisej.web/content/imagelist.md): Returns or sets the [ImageList](/api/wisej.web/content/imagelist.md) that contains the [Image](https://docs.microsoft.com/dotnet/api/system.drawing.image) displayed in a button control. (Default: `null`)

### ![](/files/hsR4ok3152WyAf8J2C1u) ImageSource

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets the theme name or URL for the image to display in the button control.

### ![](/files/hsR4ok3152WyAf8J2C1u) IsDefault

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the button control is the default button.

### ![](/files/hsR4ok3152WyAf8J2C1u) Text

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets the text associated with this control. (Default: `""`)

Newlines (CRLF) are converted to \<BR/> when [AllowHtml](#allowhtml) is false, or when [AllowHtml](#allowhtml) is true and the text doesn't contain any HTML.

### ![](/files/hsR4ok3152WyAf8J2C1u) TextAlign

[ContentAlignment](https://docs.microsoft.com/dotnet/api/system.drawing.contentalignment): Returns or sets the alignment of the text in the button control. (Default: `MiddleCenter`)

### ![](/files/hsR4ok3152WyAf8J2C1u) TextImageRelation

[TextImageRelation](/api/wisej.web/enumerations/wisej.web.textimagerelation.md): Returns or sets the position of text and image relative to each other. (Default: `ImageBeforeText`)

### ![](/files/hsR4ok3152WyAf8J2C1u) UseMnemonic

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns or sets whether the first character that is preceded by an ampersand (&) is used as the mnemonic key of the control. (Default: `True`)

## Methods

### ![](/files/lzopMboA31bVq8UIcbT3) OnClick(e)

Fires the [Click](/api/wisej.web/general/control.md#click) event.

| Parameter | Type                                                                | Description                                                                                          |
| --------- | ------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| **e**     | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) | An [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. |

### ![](/files/lzopMboA31bVq8UIcbT3) OnCommandChanged(e)

Fires the [CommandChanged](#commandchanged) event.

| Parameter | Type                                                                | Description                                                                                         |
| --------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| **e**     | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) | A [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) that contains the event data. |

### ![](/files/lzopMboA31bVq8UIcbT3) OnTextChanged(e)

| Parameter | Type                                                                | Description |
| --------- | ------------------------------------------------------------------- | ----------- |
| **e**     | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) |             |

### ![](/files/lzopMboA31bVq8UIcbT3) OnWebEvent(e)

Processes the event from the client.

| Parameter | Type                                                        | Description      |
| --------- | ----------------------------------------------------------- | ---------------- |
| **e**     | [WisejEventArgs](/api/wisej.core/general/wisejeventargs.md) | Event arguments. |

### ![](/files/lzopMboA31bVq8UIcbT3) OnWebRender(config)

Renders the client component.

| Parameter  | Type                                                          | Description                   |
| ---------- | ------------------------------------------------------------- | ----------------------------- |
| **config** | [Object](https://docs.microsoft.com/dotnet/api/system.object) | Dynamic configuration object. |

### ![](/files/hsR4ok3152WyAf8J2C1u) PerformClick()

Generates a [Click](/api/wisej.web/general/control.md#click) event for a button.

## Events

### ![](/files/hsR4ok3152WyAf8J2C1u) CommandChanged

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the [Command](#command) property value changes.

## Inherited By

| Name                                                           | Description                                                                                                                                                        |
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [Button](/api/wisej.web/buttons/button.md)                     | Represents a button control.                                                                                                                                       |
| [CheckBox](/api/wisej.web/buttons/wisej.web.checkbox.md)       | Represents a check box control.                                                                                                                                    |
| [RadioButton](/api/wisej.web/buttons/wisej.web.radiobutton.md) | Enables the user to select a single option from a group of choices when paired with other [RadioButton](/api/wisej.web/buttons/wisej.web.radiobutton.md) controls. |
| [SplitButton](/api/wisej.web/buttons/wisej.web.splitbutton.md) | Represents a split button control.                                                                                                                                 |

## Implements

| Name                                                                              | Description                                                                                                           |
| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| [IUserData](/api/wisej.web/interfaces/wisej.web.iuserdata.md)                     | Provides access to the `UserData` and `Tag` properties associated to the component implementing this interface.       |
| [IBindableComponent](/api/wisej.web/data-binding/wisej.web.ibindablecomponent.md) | Bindable components implement this interface.                                                                         |
| [ICommandSource](/api/wisej.web/interfaces/wisej.web.icommandsource.md)           | Defines an object that can invoke a [Command](/api/wisej.web/interfaces/wisej.web.icommandsource.md#command).         |
| [IDropTarget](/api/wisej.web/interfaces/wisej.web.idroptarget.md)                 | Controls that support drag & drop operations implement this interface.                                                |
| [IImage](/api/wisej.web/interfaces/wisej.web.iimage.md)                           | Provides access to common image properties across the controls that implement this interface.                         |
| [IWisejComponent](/api/wisej.core/interfaces/wisej.core.iwisejcomponent.md)       | All wisej components implement this interface.                                                                        |
| [IWisejControl](/api/wisej.core/interfaces/wisej.core.iwisejcontrol.md)           | All wisej controls derived from the [Control](/api/wisej.web/general/control.md) class must implement this interface. |
| [IWisejSerializable](/api/wisej.core/interfaces/wisej.core.iwisejserializable.md) | Allows an object to serialize itself.                                                                                 |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/api/wisej.web/buttons/wisej.web.buttonbase.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
