> For the complete documentation index, see [llms.txt](https://docs.wisej.com/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wisej.com/api/wisej.web/notifications/alertbox.md).

# AlertBox

Namespace: **Wisej.Web**

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

* [Component](/api/wisej.base/general/wisej.base.component.md)
  * [AlertBox](/api/wisej.web/notifications/alertbox.md)

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

### ![](/files/lzopMboA31bVq8UIcbT3) 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. |

### ![](/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/lIX317sDtMTZJBi9oSIx) 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** ![](/files/1vGqtbG2j637vQ4ROWOf)            | [MessageBoxIcon](/api/wisej.web/notifications/alertbox/wisej.web.messageboxicon.md)       | One of the [MessageBoxIcon](/api/wisej.web/notifications/alertbox/wisej.web.messageboxicon.md) values that specifies which icon to display in the message box.           |
| **showCloseButton** ![](/files/1vGqtbG2j637vQ4ROWOf) | [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** ![](/files/1vGqtbG2j637vQ4ROWOf)       | [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** ![](/files/1vGqtbG2j637vQ4ROWOf)  | [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** ![](/files/1vGqtbG2j637vQ4ROWOf)         | [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** ![](/files/1vGqtbG2j637vQ4ROWOf) | [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** ![](/files/1vGqtbG2j637vQ4ROWOf)       | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean)                           | Allows the message text to include HTML code.                                                                                                                            |

## 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. |
| [IWisejComponent](/api/wisej.core/interfaces/wisej.core.iwisejcomponent.md)       | All wisej components implement this interface.                                                                  |
| [IWisejSerializable](/api/wisej.core/interfaces/wisej.core.iwisejserializable.md) | Allows an object to serialize itself.                                                                           |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.wisej.com/api/wisej.web/notifications/alertbox.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
