How can you pass data from a controller to a Razor view?
- ViewBag
- ViewData
- TempData
- All of the above
You can pass data from a controller to a Razor view using multiple techniques, including ViewBag, ViewData, and TempData. These options allow you to share data between a controller and a view, but they have different lifetimes and use cases.
Loading...
Related Quiz
- In a team development scenario, two developers have created separate migrations for different features at the same time. Before merging these changes into the main branch, what precautions or steps should be taken regarding the Identity migrations?
- What is the primary purpose of Razor views in ASP.NET Core?
- What is the primary purpose of the _ViewImports.cshtml file in ASP.NET Core Razor Views?
- How does the ASP.NET Core Identity system handle migrations in a distributed deployment scenario where multiple instances might attempt to apply migrations simultaneously?
- Which action result in ASP.NET Core can be utilized to send binary content as the response?