Global Global - 3 years ago 226
ASP.NET (C#) Question

How can I set @addTagHandler globally in asp.net mvc core?

if i like to use my own TagHelper, i must add

@addTagHelper *, MyAssemly


in each cshtml-file.

Is it possible to set this global or only one time?

Answer Source

Add a _ViewImports.cshtml to your Views folder, and define your tag helpers there to have them globally on every View.

More info : https://docs.microsoft.com/en-us/aspnet/core/mvc/views/tag-helpers/intro

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download