API

@onclick

Binds a click event to a component handler.

Formal Syntax & Structure

csharp syntaxcsharp
<button @onclick="Add">Add book</button>

Working Example

Example Snippetcsharp
// Documentary fragment; see mapped lesson for context.<button @onclick="Add">Add book</button>
C# & .NET Reference