title: MVC3 passing dictionary values to dropdownlist and binding associated key to the model
body: <p>I am trying to create a mvc3 c# webapplication. What i'm trying to do, is to create a DropDownlist and passing a dictionary to it. The user in the webinterface should see the values of the dictionary and that works. But i dont want to bind the selected value to the model, instead i want the associated key. Is that somehow possible?</p>
  
  <p>In the example, you see how i bind the selected value to the model:</p>
  
  <pre><code>@Html.DropDownListFor(model =&gt; model.EditDate, new SelectList(Versions.Values), Model.EditDate)
  </code></pre>
  
  <p>The Versions.Values are DateTimes (values of the dictionary). On Submit the selected Value is bind to model.EditDate. But i want to bind the associated key of the selected Value (values are id).</p>
  
  <p>How can I do that?</p>
  
  <p>Thanks in advance</p>