-
The
_ViewImports.cshtml
can be added to any view folder, and the view engine applies the directives from both that file and theViews/_ViewImports.cshtml
file. -
The
_ViewImports.cshtml
file is additive, If you add an emptyViews/Home/_ViewImports.cshtml
file for theHome
views, there would be no change because it will import all tag helpers fromViews/_ViewImports.cshtml
file. -
If you add new tag helpers in
Views/Home/_ViewImports.cshtml
file for theHome
views, it will import all tag helpers fromViews/_ViewImports.cshtml
file, also it will import all tag helpers fromViews/Home/_ViewImports.cshtml
file. -
Any new
@addTagHelper
directives you add to theViews/Home/_ViewImports.cshtml
file (that are not in the defaultViews/_ViewImports.cshtml
file) would expose those Tag Helpers to views only in theHome
folder.
References:
No comments:
Post a Comment