Taghelpers without wild card in ASP.NET Core MVC

137 Views Asked by At

As per Microsoft we have to use the below line to add Tag Helpers.

@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

Here, they have used * as a wild card. This means it imports all tag helpers from the Microsoft.AspNetCore.Mvc.TagHelpers assembly. Correct me if I am wrong.

I don't want to use *. I only want to use asp-append-version for my Image.

What should I write instead of *?

1

There are 1 best solutions below

0
On

It will work like this.

@addTagHelper Microsoft.AspNetCore.Mvc.TagHelpers.ImageTagHelper ,Microsoft.AspNetCore.Mvc.TagHelpers  

You can follow below git hub page, where you can get the class name of all built-in tag helpers. Hope this will help someone.

https://github.com/aspnet/Mvc/tree/master/src/Microsoft.AspNetCore.Mvc.TagHelpers