Mid ASP.NET Core

How to pass data from controller to view?

  • Via ViewBag / ViewData / Model:

return View(model); // Strongly typed

ViewBag.Message = "Hello";

ViewData["Count"] = 5;

More from ASP.NET Core Tutorial

All questions for this course