aspnetcore
aspnetcore copied to clipboard
Razor syntax error in template?
I have dotnet version2.1.300-preview2-008533,
When I create a template for blazor, my counters button is
<button onclick="IncrementCounter"
Why is it in every other template I see such as on scotts april 3rd podcast, the function is called like the following
<button @onclick(IncrementCounter) >
I get an error stating onclick cannot be found but this seems to be typical razor syntax?
@OnClick(IncrementCounter) is old syntax.
As the current templates show when you create a new project in VS, you should use
onclick=@IncrementCounter or onclick="@IncrementCounter"
Thanks. Ive been chasing my tail for like an hour..