Home > DeveloperSection > Interviews > How to create dynamic property with the help of ViewBag in Asp.net MVC?

Posted on    September-17-2011 2:40 AM

 ASP.NET MVC ASP.NET MVC 
Ratings:
 1 Answer(s)
  5349  View(s)
Rate this:

Chris Anderson
Chris Anderson

Total Post:197

Points:985
Posted on    September-17-2011 12:00 AM

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.


Don't want to miss updates? Please click the below button!

Follow MindStick