ViewData and ViewBag Use the same data source, so the data is just like the viewbag is no longer the dictionary's key-value pair structure, but dynamic type (http://www.cnblogs.com/kissdodog/ Archive/2013/01/20/2868644.html), which is dynamically parsed when the program is running. However, ViewBag only works if the Access keyword is a valid C # identifier. For example viewdata["have space"] with ViewBag is inaccessible. viewdata[] The Key/value,value is an object data type that is passed to the view layer to be converted to strongly typed data by using the as operation, but ViewBag determines the data type at run time and therefore does not have to be converted at all. The non-conversion types here are all types, such as being able to pass datetime,string, other custom types, and so on. But in terms of efficiency, viewdata[] is slightly higher.
In ActionResult:viewdata["list"] = peoplelist;
The conversion is required on the page:@foreach (People_model item in (viewdata["list"] as IEnumerable<people_model>)) {
You do not need to convert using ViewBag
ViewData and ViewBag