How to create dynamic property with the help of ViewBag in Asp.net MVC? Chris Anderson846317-Sep-2011asp.net mvcasp.net mvc Updated on 22-Sep-2020
Chris Anderson
17-Sep-2011List<string> countries=new List<string>();
countries.Add("India");
countries.Add("USA");
countries.Add("Canada");
ViewBag.Countries=countries; //here Countries is a dynamic property associated with the Viewbag.