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.
Loading...
Related Quiz
- To enable MVC in ASP.NET Core's Startup.cs, which method should be invoked inside the ConfigureServices method?
- To serve static files, one must configure the necessary _________ in the Startup.cs file.
- You are tasked with setting up an ASP.NET Core environment on a Linux machine. What steps would be essential to ensure the application can be developed, built, and run seamlessly?
- The process of generating a unique token for password reset or email confirmation in ASP.NET Core Identity is handled by the _________ service.
- Which of the following files replaced project.json in .NET Core 2.0 and later versions?