In the context of Razor views, which directive would you use in _ViewImports.cshtml to define a shared model type across views?
- @model
- @inherits
- @using
- @namespace
To define a shared model type across Razor views, you would use the @inherits directive in the _ViewImports.cshtml file. This directive specifies the base class for all views in the directory, allowing you to set a common model type for those views.
Loading...
Related Quiz
- The @ symbol in a Razor view is used to denote the beginning of ________.
- Where is the configuration for routes primarily done in an ASP.NET Core MVC application?
- If you have multiple migrations pending, in which order does ASP.NET Core apply them?
- In an ASP.NET Core project, which folder typically contains static files like images, scripts, and stylesheets?
- You're building a Razor form and want to include a file upload feature. Which input type would you use to facilitate this?