# BlazorSheetControl.DisposeAsync Method

> BlazorSheetControl.DisposeAsync method in the TX Sheet Control .NET API: Releases the editor, its event subscriptions and this instance's callback reference.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Method
- **Namespace:** `TXTextControl.TXSheetControl.Blazor`
- **Package:** `TXTextControl.TXSheetControl.Blazor` (assembly `TXTextControl.TXSheetControl.Blazor.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Path:** TX Sheet Control > API Reference > .NET API > TXTextControl.TXSheetControl.Blazor > BlazorSheetControl > BlazorSheetControl.DisposeAsync Method
- **684 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-blazor/blazorsheetcontrol/disposeasync-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-blazor/blazorsheetcontrol/disposeasync-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-blazor/blazorsheetcontrol/disposeasync-method/llms-full.txt

---

Releases the editor, its event subscriptions and this instance's callback reference. Safe to call repeatedly.

### Syntax

```csharp
public ValueTask DisposeAsync()
```

### Return Value

`ValueTask`. Completes after the operation.

### Exceptions

API failures throw `ServerSheetControlException` with a code. A canceled operation throws `OperationCanceledException`. Browser filesystem overloads and synchronous C# cell renderers throw `PlatformNotSupportedException`.

### Examples

The component owns its primary control. For a separately owned mail-merge result, dispose the result after saving:

```csharp
var sheet = await control.Workbook.Sheets.AtAsync(0);
await sheet.Cell("F2").SetValueAsync("Customer");
await control.Workbook.SetMailMergeAsync(new
{
    version = 1, bindings = new[] { new { sheetId = sheet.Id, cell = "F2", path = "customer" } },
    repeatBlocks = Array.Empty<object>()
});
var template = await control.Workbook.CreateMailMergeTemplateAsync();
var result = await template.MergeAsync(new { customer = "Fabrikam" });
try { byte[] pdf = await result.Control.SaveAsync(StreamType.PDF); }
finally { await result.Control.DisposeAsync(); }
```

### Remarks

Disposal is idempotent. The Blazor component disposes its own primary control when removed.

### See Also

- [BlazorSheetControl](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-blazor/blazorsheetcontrol/llms-full.txt).

---

## Nearby

- **Previous:** [BlazorSheetControl.BatchAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-blazor/blazorsheetcontrol/batchasync-method/llms-full.txt)
- **Next:** [BlazorSheetControl.Events Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-blazor/blazorsheetcontrol/events-property/llms-full.txt)
