Thursday, January 30, 2020

how to render a partial in modern times (2020) .NET Core 3 MVC

If you try this you'll get this:

Use of IHtmlHelper.RenderPartial may result in application deadlocks. Consider using <partial> Tag Helper or IHtmlHelper.RenderPartialAsync.

 
 

The better way to go is:

@{ await Html.RenderPartialAsync("_MyPartial", myModel; }

No comments:

Post a Comment