1. Session 2. TempData 3. ViewBag 4.ViewData
There are several ways to do this in ASP.NET MVC Hidden Field Cookies Query String ViewData ViewBag TempData
T here are several ways to do this in ASP.NET MVC Hidden Field Cookies Query String ViewData ViewBag TempData
ASP.NET MVC offers us three options ViewData, VieBag and TempData for passing data from controller to view and in next request. ViewData and ViewBag are almost similar and TempData performs additional responsibility public ActionResult Index() {ViewBag.Name = "Monjurul Habib";return View(); } public ActionResult Index() {ViewData["Name"] = "Monjurul Habib";return View(); } @ViewBag.Name @ViewData["Name"]