Which directive in _ViewImports.cshtml allows you to set the base class for the Razor views?

  • @inherits
  • @model
  • @using
  • @layout
The correct directive to set the base class for Razor views in _ViewImports.cshtml is @inherits. This directive specifies the full name of the class that the view should inherit from. It allows you to establish a custom base class for all views in a folder or the entire application, enabling you to add shared functionality to your views.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *