Skip to content

Instantly share code, notes, and snippets.

@scottsauber
Created July 21, 2020 20:23
Show Gist options
  • Save scottsauber/44807aee8e3d418010428e2c2846cde9 to your computer and use it in GitHub Desktop.
Save scottsauber/44807aee8e3d418010428e2c2846cde9 to your computer and use it in GitHub Desktop.
@page "/counter"
<h1>Counter</h1>
<p id="current-count">Current count: @CurrentCount</p>
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
@code {
public int CurrentCount { get; set; }
private void IncrementCount()
{
CurrentCount++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment