title: Load DropDownList from ViewData in MVC 2
body: <p>I have the following View. This is the whole code of my view</p>
  
  <pre><code>&lt;asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server"&gt;
      &lt;script src="http://code.jquery.com/jquery-1.9.1.js"&gt;&lt;/script&gt;
      &lt;script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"&gt;&lt;/script&gt;
  &lt;/asp:Content&gt;
  
  &lt;asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server"&gt;
      &lt;div&gt;
          &lt;table&gt;
              &lt;tr&gt;
                  &lt;td&gt;
                      &lt;select id="clientDDL"&gt;
                      &lt;/select&gt;
                      &lt;% Html.DropDownList("clientDDL",
                          new SelectList((IEnumerable)ViewData["Clients"], "Code", "Name")); %&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
      &lt;/div&gt;
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>I use the next ViewData from my Model:</p>
  
  <pre><code>public static List&lt;lookup&gt; GetClients()
          {
              using (ModelDataContext data = new ModelDataContext(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ToString()))
              {
                  List&lt;lookup&gt; retVal = new List&lt;lookup&gt;();
                  List&lt;Client&gt; lClient = data.Clients.Where(a =&gt; a.IsActive == true).ToList();
                  lClient = lClient.OrderBy(o =&gt; o.ClientName).ToList();
  
                  foreach (Client item in lClient)
                  {
                      retVal.Add(new lookup() { Code = item.ClientID.ToString(), Name = item.ClientName, });
                  }
                  return retVal;
              }            
          }
  </code></pre>
  
  <p>This is my Controller:</p>
  
  <pre><code>public ActionResult ProcedureFilter()
          {
              ViewData["Clients"] = WorkflowModels.GetClients();
              return View();
          }
  </code></pre>
  
  <p>What did I miss? My DropDownList is still empty. Maybe i have to put some reference? Any suggestions please.</p>
  
  <p>UPDATE:
  The problem was ';' at the end of part &lt;%= %>. The works code:</p>
  
  <pre><code>&lt;%= Html.DropDownList("clientDDL",
                              new SelectList((IEnumerable)ViewData["Clients"], "Code", "Name")) %&gt;
  </code></pre>