aspnetcore/test/testapps/BasicTestApp/CounterComponent.cshtml

19 lines
391 B
Plaintext

<h1>Counter</h1>
<p>Current count: @currentCount</p>
<p><button onclick="@((handleClicks ? (Action)IncrementCount : null))">Click me</button></p>
<label>
<input type="checkbox" bind="@handleClicks" />
Toggle click handler registration
</label>
@functions {
int currentCount = 0;
bool handleClicks = true;
void IncrementCount()
{
currentCount++;
}
}