# IButtonControlExtensions

Namespace: **Wisej.Web.Markup**

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

Adds [fluent markup](https://learn.microsoft.com/en-us/dotnet/communitytoolkit/maui/markup/markup) extension methods to the [IButtonControl](/api/wisej.web/interfaces/wisej.web.ibuttoncontrol.md) interface.

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

```csharp
public class IButtonControlExtensions
```

{% endtab %}

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

```visual-basic
Public Class IButtonControlExtensions
```

{% endtab %}
{% endtabs %}

## Methods

### ![](/files/lIX317sDtMTZJBi9oSIx) DialogResult\<TButtonControl>(buttonControl, dialogResult)

Sets the DialogResult property of the specified [IButtonControl](/api/wisej.web/interfaces/wisej.web.ibuttoncontrol.md).

| Parameter          | Type                                                                                            | Description                                                                                                             |
| ------------------ | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| **TButtonControl** |                                                                                                 | The type of the button control, must implement [IButtonControl](/api/wisej.web/interfaces/wisej.web.ibuttoncontrol.md). |
| **buttonControl**  | [TButtonControl](/api/wisej.web.markup/extensions/wisej.web.markup.ibuttoncontrolextensions.md) | The button control for which to set the DialogResult property.                                                          |
| **dialogResult**   | [DialogResult](/api/wisej.web/enumerations/wisej.web.dialogresult.md)                           | The [DialogResult](#dialogresult``1) value to set for the button control.                                               |

**Returns:** [TButtonControl](/api/wisej.web.markup/extensions/wisej.web.markup.ibuttoncontrolextensions.md). The modified button control with the updated DialogResult property.

This method allows you to set the DialogResult for a button control, which specifies the result returned to the parent form when the button is clicked.

```csharp

myButton.DialogResult(DialogResult.OK);

```


---

# 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.markup/extensions/wisej.web.markup.ibuttoncontrolextensions.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.
