How do I do the above? I\'ve started using MVC and I\'m having issues passing data around.
My specific problem is to do with a list of objects I have in my Model whi
The quick and dirty way is to pass it via ViewData
public ActionResult List() { ViewData["MyList"] = new List () {"test1", "test2"}; return View (); }
then you can access it in your view
<% foreach (string item in (List)ViewData["MyList"]) { %> <%= item %> <% }%>