title: ASP.NET MVC - How to pass an Array to the view?
body: <p>I'm struggling myself here, to find a easy way to pass an array from the controller to the view on ASP.NET MVC framework.</p>
  
  <p>so in my controller I would have something like:</p>
  
  <pre><code>public class HomeController : ApplicationController
  {   
      public ActionResult Index()
      {
          string[] myArray = { "value01", "value02", "value03"};
          ViewData["passedArray"] = myArray;
          return View();
      }
  }
  </code></pre>
  
  <p>so in my view I would have just a call to <b>ViewData["passedArray"]</b> and run a loop on it.</p>
  
  <p>But apparently the <b>ViewData</b> is being received by the view as <b>System.String</b>, probably because of the declaration on the Array DataType, but unfortunately I don't know how to pass it properly and simply without create millions of code lines.</p>
  
  <p>It would be fantastic if one could help me.</p>
  
  <p>Thanks in advance</p>