HOW TO CREATE DYNAMIC PROPERTY WITH THE HELP OF VIEWBAG IN ASP.NET MVC?

Chris Anderson

Total Post:197

Points:985
Posted by  Chris Anderson
 6094  View(s)
Ratings:
Rate this:
  1. Chris Anderson

    Post:197

    Points:985
    How to create dynamic property with the help of ViewBag in Asp.net MVC?

    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.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!