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.
Add your answer
Loading...

Leave a comment

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