How to create dynamic property with the help of ViewBag in Asp.net MVC?
Ask by Chris Anderson
Updated 22 Sep 2020
List<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.