In this article we will under stand How to Pass Data From Controller to View.
How to Pass Data From Controller to View using ViewBag and ViewData?
View attachment 1285
Both are used to pass data from controller to view.
ViewData is a dictionary of objects which store and retrieve the data based on key.
ViewBag uses the dynamic keyword internally and...
ViewBag & ViewData Asp.Net MVC
How to Pass Data From Controller to View using ViewBag and ViewData?
View attachment 1285
Both are used to pass data from controller to view.
ViewData is a dictionary of objects which store and retrieve the data based on key.
Code:
ViewData["Today"] = DateTime.Now;
ViewBag & ViewData Asp.Net MVC