Should I change @Html.Partial to @Html.PartialAsync as Visual Studio suggest?

Yes we should,
See below section from their official site

Migrate from an HTML Helper

Consider the following asynchronous HTML Helper example. A collection of products is iterated and displayed. Per the PartialAsync method’s first parameter, the _ProductPartial.cshtml partial view is loaded. An instance of the Product model is passed to the partial view for binding.

CSHTML 
    @foreach (var product in Model.Products)
    {
        @await Html.PartialAsync("_ProductPartial", product)
    }

The following Partial Tag Helper achieves the same asynchronous rendering behavior as the PartialAsync HTML Helper. The model attribute is assigned a Product model instance for binding to the partial view.

CSHTML 
@foreach (var product in Model.Products)
{
    <partial name="_ProductPartial" model="product" />
} 

Copied from
https://learn.microsoft.com/en-us/aspnet/core/mvc/views/tag-helpers/built-in/partial-tag-helper?view=aspnetcore-2.1

Leave a Comment