# SheetControlErrorEventArgs.Code Property

> SheetControlErrorEventArgs.Code property in the TX Sheet Control .NET API: Machine-readable initialization or event-handler error code.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Property
- **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 > SheetControlErrorEventArgs > SheetControlErrorEventArgs.Code Property
- **266 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-blazor/sheetcontrolerroreventargs/code-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-blazor/sheetcontrolerroreventargs/code-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-blazor/sheetcontrolerroreventargs/code-property/llms-full.txt

---

Machine-readable initialization or event-handler error code.

### Syntax

```csharp
public string Code { get; init; }
```

### Property Value

`string`. Machine-readable initialization or event-handler error code.

### Examples

```csharp
private string errorMessage = "";
private void OnError(SheetControlErrorEventArgs args)
{
    errorMessage = $"{args.Code}: {args.Message}";
}
// Bind errorMessage to application UI, for example a role="alert" element.
```

### Remarks

Callback data is a detached snapshot. Update application UI in the callback and obtain a current workbook handle before editing cells.

### See Also

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

---

## Nearby

- **Previous:** [SheetControlErrorEventArgs Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-blazor/sheetcontrolerroreventargs/constructor/llms-full.txt)
- **Next:** [SheetControlErrorEventArgs.Message Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-blazor/sheetcontrolerroreventargs/message-property/llms-full.txt)
