The @Helpers
is gone from Razor in ASP.NET Core 3.1
and now as an alternative suggested to use Razor code blocks.
https://docs.microsoft.com/en-us/aspnet/core/mvc/views/razor?view=aspnetcore-3.1#razor-code-blocks
Unfortunately, if I add example code
@{
void RenderName(string name)
{
<p>Name: <strong>@name</strong></p>
}
}
to Razor page(cshtml) I get error form Intelisence cannot resolve value, it shows that HTML is not accepted in that place and c# code expected. How to use Razor code blocks?