2
Reply

What is ViewImports in ASP.NET Core MVC

Ranjit Kumar

Ranjit Kumar

Oct 06
618
0
Reply

    In ASP.NET Core MVC, the ViewImports file is used to globally import namespaces, tag helpers, and other configurations for Razor views. This eliminates the need to repeatedly include namespaces or directives in every Razor page or view file.

    Example of ViewImport

    1. @using MyApp.Models
    2. @using MyApp.Services
    3. @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
    4. @addTagHelper *, MyApp

    Just Some Class Never Mind

    Mehran
    Nov 17
    0