title: ASP.NET MVC 2 - Populate drop down list from a Dictionary
body: <p>I'm trying to poplulate a drop down list in MVC 2 from a Dictionary{string, string}.
  My code below, that is not quite right...</p>
  
  <p>states is the Dictionary. Help</p>
  
  <pre><code>&lt;tr&gt;
  &lt;td class="formtext"&gt;
      &lt;%: Html.LabelFor(m =&gt; m.State)%&gt; &lt;strong&gt;*&lt;/strong&gt;
  &lt;/td&gt;
  &lt;td align="left"&gt;
      &lt;%= Html.DropDownList("statesDropDown", null, null, new { @class = "ddlAttributeGroups" })%&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>ActionResult:</p>
  
  <pre><code>var states = new States().GetStates();
  var statesDropDown = new SelectList(states, states.Keys.ToString(), states.Values.ToString());
  ViewData["statesDropDown"] = statesDropDown;
  </code></pre>