title: Iterating through ArrayList in ViewData ASP.NET MVC
body: <p>I am writing an application wherein I need to iterate through a ArrayList sent by the controller to the view using Viewdata.</p>
  
  <p>The controller action:</p>
  
  <pre>
  public ActionResult ConfirmItemsList(string[] arr)
  {
     // I generate ArrayList here , call it arrayLst
  
     ViewData["ItemsList"] = arrayLst;
  }
  </pre>
  
  <p>Now I need to iterate this ViewData and display as unordered list in the view ( which is not strongly typed ), but am not able to get the syntax of for/foreach right.</p>
  
  <p>I keep getting the error : foreach statement cannot operate on variables of type 'object' because 'object' does not contain a public definition for 'GetEnumerator'</p>
  
  <p>Can some one please help me.</p>
  
  <p>Thanks.</p>