What is the difference between partial tag helper and HTML helper in asp.net core?

Viewed 3269

What is the difference between partial tag helper implemented in .net core 2.1:

<partial name="_AuthorPartial" />

and

@await Html.PartialAsync("_AuthorPartial")

Which one should I use in the production and what are the benefits?

1 Answers

The short answer is that there isn't a difference when it comes to how the server handles them. The end result is exactly the same from a server perspective.

There are some benefits (from a developer's perspective) listed here that are worth noting, specifically the improved Intellisense that they provide.

In my experience, Tag Helpers are also easier for UI designers to read and use as they look and feel more like HTML than Html Helpers.

Related