title: Create Labels and Values for HTML DropDownList in MVC View
body: <p>I have the following, which posts "IT" and "HR" as values in model. I want IT and HR as Label, and 0 and 1 as values to controller.</p>
  
  <pre><code>@Html.DropDownList("DepartmentId", new SelectList(new[] { "IT", "HR" }))
  </code></pre>
  
  <p>And when i get the view, how can i have pre-selected value in the dropdown with the matching value in Department ID in model. So if an item has Id as HR, the dropdown should already have HR as selected, and then a person can change it to IT, and that option can be saved.</p>
  
  <p>Any Help ??
  Please note i don't want to change my model.</p>
  
  <p><strong>ANSWER</strong>
  Big Thanks  to  <strong>Terry Nederveld</strong> for giving this answer : </p>
  
  <pre><code> @Html.DropDownList("DepartmentId", new SelectList(new[] { new KeyValuePair&lt;string, int&gt;("IT", 1), new KeyValuePair&lt;string, int&gt;("HR", 2) }, "Value", "Key", (Model.ServiceItem.DepartmentId.Equals(1) ? 1 : 2)))
  </code></pre>