Skip to content

Instantly share code, notes, and snippets.

@swlkr
Created October 20, 2026 15:16
Show Gist options
  • Select an option

  • Save swlkr/7fe2f2aa48166f7db4e628146f4197e2 to your computer and use it in GitHub Desktop.

Select an option

Save swlkr/7fe2f2aa48166f7db4e628146f4197e2 to your computer and use it in GitHub Desktop.
@page "/counter"
@rendermode InteractiveServer
<PageTitle>Counter</PageTitle>
<h1>Counter</h1>
<p role="status">Current count: @currentCount</p>
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
@code {
private int currentCount = 0;
private void IncrementCount()
{
currentCount++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment