# AlertBox

Namespace: **Wisej.Web**

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

* [Component](https://docs.wisej.com/api/wisej.base/general/wisej.base.component)
  * [AlertBox](https://docs.wisej.com/api/wisej.web/notifications/alertbox)

Displays an alert box that can contain an icon and text that inform and instruct the user. Alert boxes are not modal and can disappear automatically.

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

```csharp
public class AlertBox : Component
```

{% endtab %}

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

```visual-basic
Public Class AlertBox
    Inherits Component
```

{% endtab %}
{% endtabs %}

## Methods

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnAddReferences(list)

Returns a collection of referenced components or collection of components.

| Parameter | Type                                                                    | Description                                                |
| --------- | ----------------------------------------------------------------------- | ---------------------------------------------------------- |
| **list**  | [IList](https://docs.microsoft.com/dotnet/api/system.collections.ilist) | List of referenced components or collection of components. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnWebRender(config)

Renders the client component.

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

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-e4f8ed47a52590951f725a10c269555e81d41d81%2Fstatic.png?alt=media) Show(text, icon, showCloseButton, alignment, autoCloseDelay, onclose, showProgressBar, allowHtml)

Displays an alert box with the specified text and icon in the specified position.

| Parameter                                                                                                                                                                                                                         | Type                                                                                                   | Description                                                                                                                                                                       |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **text**                                                                                                                                                                                                                          | [String](https://docs.microsoft.com/dotnet/api/system.string)                                          | The text to display in the message box. Newlines (CRLF) are converted to \<BR/> when the text doesn't contain any html.                                                           |
| **icon** ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-723b640963c6cd781ff8c5ce5b24149fa0af7b9c%2Fbadge-optional.svg?alt=media)            | [MessageBoxIcon](https://docs.wisej.com/api/wisej.web/notifications/alertbox/wisej.web.messageboxicon) | One of the [MessageBoxIcon](https://docs.wisej.com/api/wisej.web/notifications/alertbox/wisej.web.messageboxicon) values that specifies which icon to display in the message box. |
| **showCloseButton** ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-723b640963c6cd781ff8c5ce5b24149fa0af7b9c%2Fbadge-optional.svg?alt=media) | [Nullable\<Boolean>](https://docs.microsoft.com/dotnet/api/system.nullable-1)                          | Shows or hides the close button. If not set it's managed automatically.                                                                                                           |
| **alignment** ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-723b640963c6cd781ff8c5ce5b24149fa0af7b9c%2Fbadge-optional.svg?alt=media)       | [ContentAlignment](https://docs.microsoft.com/dotnet/api/system.drawing.contentalignment)              | One of the [ContentAlignment](https://docs.microsoft.com/dotnet/api/system.drawing.contentalignment) values that specifies where on the screen to display the alert box.          |
| **autoCloseDelay** ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-723b640963c6cd781ff8c5ce5b24149fa0af7b9c%2Fbadge-optional.svg?alt=media)  | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                                            | A value in milliseconds that determines the delay after which the alert box disappears automatically. The default is 5000 (5 seconds). If set to 0 the box stays open.            |
| **onclose** ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-723b640963c6cd781ff8c5ce5b24149fa0af7b9c%2Fbadge-optional.svg?alt=media)         | [Action](https://docs.microsoft.com/dotnet/api/system.action)                                          | Optional async handler for the close event; called when the Alert Box is closed either automatically or by the user.                                                              |
| **showProgressBar** ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-723b640963c6cd781ff8c5ce5b24149fa0af7b9c%2Fbadge-optional.svg?alt=media) | [Nullable\<Boolean>](https://docs.microsoft.com/dotnet/api/system.nullable-1)                          | Shows a progress bar to display the time remaining until the alert box is automatically closed. If left null, it's managed by the theme.                                          |
| **allowHtml** ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-723b640963c6cd781ff8c5ce5b24149fa0af7b9c%2Fbadge-optional.svg?alt=media)       | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean)                                        | Allows the message text to include HTML code.                                                                                                                                     |

## Implements

| Name                                                                                                 | Description                                                                                                     |
| ---------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| [IUserData](https://docs.wisej.com/api/wisej.web/interfaces/wisej.web.iuserdata)                     | Provides access to the `UserData` and `Tag` properties associated to the component implementing this interface. |
| [IWisejComponent](https://docs.wisej.com/api/wisej.core/interfaces/wisej.core.iwisejcomponent)       | All wisej components implement this interface.                                                                  |
| [IWisejSerializable](https://docs.wisej.com/api/wisej.core/interfaces/wisej.core.iwisejserializable) | Allows an object to serialize itself.                                                                           |
