title: MVC - Displaying Content
body: <p>How to Display the following </p>
  
  <pre><code>     public ActionResult Index()
       {
          IEnumerable&lt;int&gt; items = Enumerable.Range(1000, 5);
          ViewData["Collection"] = items;
          return View();
      }
  </code></pre>
  
  <p>in "View"</p>
  
  <pre><code>&lt;ul&gt;
       &lt;% foreach(int i in  (IEnumerable)ViewData["Collection"]){ %&gt;
         &lt;li&gt;
               &lt;% =i.ToString(); }%&gt;
         &lt;/li&gt;    
  &lt;/ul&gt;    
  </code></pre>
  
  <p>the foreach throws System.Web.HttpCompileException.</p>