In a typical ASP.NET Core MVC application, how is data passed from the "Controller" to the "View"?

  • ViewData, ViewBag, TempData
  • Direct method invocation
  • HttpContext
  • SignalR
In ASP.NET Core MVC, data is primarily passed from the Controller to the View using ViewData, ViewBag, or TempData. These mechanisms allow you to share data between the Controller and View to render dynamic content in the HTML page. ViewData is a dictionary-like container, ViewBag uses dynamic properties, and TempData is used for temporary data storage between two successive requests.
Add your answer
Loading...

Leave a comment

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