> 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/common-dialogs/wisej.web.commondialog.md).

# CommonDialog

Namespace: **Wisej.Web**

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

Specifies the base class used for displaying dialog boxes on the screen.

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

```csharp
public class CommonDialog : Component
```

{% endtab %}

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

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

{% endtab %}
{% endtabs %}

## Constructors

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

Initializes a new instance of [CommonDialog](/api/wisej.web/common-dialogs/wisej.web.commondialog.md).

### ![](/files/hsR4ok3152WyAf8J2C1u) CommonDialog(container)

Initializes a new instance of the [CommonDialog](/api/wisej.web/common-dialogs/wisej.web.commondialog.md) extender with a specified container.

| Name          | Type                                                                                 | Description                                                                                                                                                                                                     |
| ------------- | ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **container** | [IContainer](https://docs.microsoft.com/dotnet/api/system.componentmodel.icontainer) | An [IContainer](https://docs.microsoft.com/dotnet/api/system.componentmodel.icontainer) that represents the container of the [CommonDialog](/api/wisej.web/common-dialogs/wisej.web.commondialog.md) component. |

## Properties

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

[Type](https://docs.microsoft.com/dotnet/api/system.type): Returns or sets the type of the common dialog UI control to show when calling the [ShowDialog](#showdialog) method. (Default: `null`)

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

[Object](https://docs.microsoft.com/dotnet/api/system.object): Returns or sets an object that contains data about the control. (Default: `null`)

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

[String](https://docs.microsoft.com/dotnet/api/system.string): Returns or sets the dialog box title. (Default: `""`)

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

[FormWindowState](/api/wisej.web/containers/form/wisej.web.formwindowstate.md): Returns or sets the initial [WindowState](#windowstate) of the common dialog. (Default: `Normal`)

## Methods

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

Creates the UI for the CommonDialog.

**Returns:** [Form](/api/wisej.web/containers/form.md). An instance of [Form](/api/wisej.web/containers/form.md).

### ![](/files/lzopMboA31bVq8UIcbT3) Dispose(disposing)

| Parameter     | Type                                                            | Description |
| ------------- | --------------------------------------------------------------- | ----------- |
| **disposing** | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) |             |

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

Fires the [HelpRequested](#helprequested) event.

| Parameter | Type                                                                | Description                                                                                                 |
| --------- | ------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| **e**     | [EventArgs](https://docs.microsoft.com/dotnet/api/system.eventargs) | An [HelpEventArgs](/api/wisej.web/general/control/wisej.web.helpeventargs.md) that provides the event data. |

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

When overridden in a derived class, resets the properties of a common dialog box to their default values.

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

Runs a common dialog box with a default owner.

**Returns:** [DialogResult](/api/wisej.web/enumerations/wisej.web.dialogresult.md). [OK](/api/wisej.web/enumerations/wisej.web.dialogresult.md#fields) if the user clicks OK in the dialog box; otherwise, [Cancel](/api/wisej.web/enumerations/wisej.web.dialogresult.md#fields).

### ![](/files/hsR4ok3152WyAf8J2C1u) ShowDialog(onclose)

Runs a common dialog box with a default owner.

| Parameter                                    | Type                                                                           | Description                                                                                                                                                                                                                                                                                                                                           |
| -------------------------------------------- | ------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **onclose** ![](/files/1vGqtbG2j637vQ4ROWOf) | [Action\<DialogResult>](https://docs.microsoft.com/dotnet/api/system.action-1) | Optional async handler for the close event; called when the form/dialog has been closed. It's the equivalent of handling the [event.](/api/wisej.web/containers/form.md#formclosed) When the *onclose* event handler is specified, the modal dialog doesn't suspend the execution on the server but it's still shown as a modal dialog on the client. |

**Returns:** [DialogResult](/api/wisej.web/enumerations/wisej.web.dialogresult.md). [OK](/api/wisej.web/enumerations/wisej.web.dialogresult.md#fields) if the user clicks OK in the dialog box; otherwise, [Cancel](/api/wisej.web/enumerations/wisej.web.dialogresult.md#fields).

### ![](/files/hsR4ok3152WyAf8J2C1u) ShowDialog(owner)

Runs a common dialog box with the specified owner.

| Parameter | Type                                      | Description                                                                                                                      |
| --------- | ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| **owner** | [Form](/api/wisej.web/containers/form.md) | A [Form](/api/wisej.web/containers/form.md) that represents the top-level window that owns the modal dialog box. It can be null. |

**Returns:** [DialogResult](/api/wisej.web/enumerations/wisej.web.dialogresult.md). [OK](/api/wisej.web/enumerations/wisej.web.dialogresult.md#fields) if the user clicks OK in the dialog box; otherwise, [Cancel](/api/wisej.web/enumerations/wisej.web.dialogresult.md#fields).

### ![](/files/hsR4ok3152WyAf8J2C1u) ShowDialog(owner, onclose)

Runs a common dialog box with the specified owner.

| Parameter                                    | Type                                                                           | Description                                                                                                                                                                                                                                                                                                                                           |
| -------------------------------------------- | ------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **owner**                                    | [Form](/api/wisej.web/containers/form.md)                                      | A [Form](/api/wisej.web/containers/form.md) that represents the top-level window that owns the modal dialog box. It can be null.                                                                                                                                                                                                                      |
| **onclose** ![](/files/1vGqtbG2j637vQ4ROWOf) | [Action\<DialogResult>](https://docs.microsoft.com/dotnet/api/system.action-1) | Optional async handler for the close event; called when the form/dialog has been closed. It's the equivalent of handling the [event.](/api/wisej.web/containers/form.md#formclosed) When the *onclose* event handler is specified, the modal dialog doesn't suspend the execution on the server but it's still shown as a modal dialog on the client. |

**Returns:** [DialogResult](/api/wisej.web/enumerations/wisej.web.dialogresult.md). [OK](/api/wisej.web/enumerations/wisej.web.dialogresult.md#fields) if the user clicks OK in the dialog box; otherwise, [Cancel](/api/wisej.web/enumerations/wisej.web.dialogresult.md#fields).

### ![](/files/hsR4ok3152WyAf8J2C1u) ShowDialogAsync(owner)

Runs a common dialog box with the specified owner asynchronously.

| Parameter                                  | Type                                      | Description                                                                                                                      |
| ------------------------------------------ | ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| **owner** ![](/files/1vGqtbG2j637vQ4ROWOf) | [Form](/api/wisej.web/containers/form.md) | A [Form](/api/wisej.web/containers/form.md) that represents the top-level window that owns the modal dialog box. It can be null. |

**Returns:** [Task\<DialogResult>](https://docs.microsoft.com/dotnet/api/system.threading.tasks.task-1). [OK](/api/wisej.web/enumerations/wisej.web.dialogresult.md#fields) if the user clicks OK in the dialog box; otherwise, [Cancel](/api/wisej.web/enumerations/wisej.web.dialogresult.md#fields).

## Events

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

[EventHandler](https://docs.microsoft.com/dotnet/api/system.eventhandler) Fired when the user clicks the Help button on a common dialog box.

## Inherited By

| Name                                                                                  | Description                                                                                                                       |
| ------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| [ColorDialog](/api/wisej.web/common-dialogs/wisej.web.colordialog.md)                 | Represents a common dialog box that displays available colors along with controls that enable the user to define custom colors.   |
| [FileDialog](/api/wisej.web/common-dialogs/wisej.web.filedialog.md)                   | Displays a dialog box from which the user can select a file.                                                                      |
| [FolderBrowserDialog](/api/wisej.web/common-dialogs/wisej.web.folderbrowserdialog.md) | Allows the user to select a folder from one of the [Roots](/api/wisej.web/common-dialogs/wisej.web.folderbrowserdialog.md#roots). |
| [OpenFileDialog](/api/wisej.web/common-dialogs/wisej.web.openfiledialog.md)           | Prompts the user to open a file from the server.                                                                                  |
| [SaveFileDialog](/api/wisej.web/common-dialogs/wisej.web.savefiledialog.md)           | Prompts the user to select a location for saving a file on the server.                                                            |


---

# 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/common-dialogs/wisej.web.commondialog.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.
