0

I have an ASP.NET Core MVC project that uses partial views. When I compile it I receive the following warning:

Use of IHtmlHelper.Partial may result in application deadlocks. Consider using Tag Helper or IHtmlHelper.PartialAsync.

What is the difference between what the Tag Helper does and what the HTML Helper does, that would cause an application deadlock?

From reading documentation here, my understanding was that the Tag Helper approach aims to make the markup easier to read and allows Intellisense support. In other words I thought the two approaches were just different syntax for the same thing, but clearly something else is going on here.

Should one always use a Tag Helper instead of a HTML Helper?

Owen Pauling
  • 11,349
  • 20
  • 53
  • 64

1 Answers1

1

Tag Helpers are new to ASP.NET Core and besides the advantages you have mentioned, it is worth mentioning: they are processed by Razor on the server (more robust, reliable and maintainable) and you can create your own custom TagHelpers very simply (implement the ITagHelper interface or inherit from the TagHelper class and override the Process method by defining its implementation).

leandro.andrioli
  • 997
  • 5
  • 12