title: ASP.NET MVC4 + Get drop down value after HttpPost submit
body: <p>So I want to get a value of the dropdown (== id of the account) to insert a new transaction
      Here below you can find my View:</p>
  
  <pre><code>    &lt;div id="content"&gt;
          &lt;h2&gt;Overschrijving&lt;/h2&gt;
          &lt;p id="topmsg"&gt;velden met een * zijn verplicht&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;
          &lt;dl class="clearfix form"&gt;
              @using (Html.BeginForm(new { ReturnUrl = ViewBag.ReturnUrl })) {
                  @Html.ValidationSummary(true, "Gelieve alles correct in te vullen.")
  
                  &lt;dt&gt;@Html.Label("Rekening: *")&lt;/dt&gt;
                  &lt;dd&gt;@Html.DropDownList("ddlAccounts")&lt;/dd&gt;
                  &lt;dt&gt;@Html.Label("Begunstigde: *")&lt;/dt&gt;
                  &lt;dd&gt;@Html.TextBox("ToAccountNumber")&lt;/dd&gt;
                  &lt;dt&gt;@Html.Label("Bedrag: *")&lt;/dt&gt;
                  &lt;dd&gt;@Html.TextBox("Amount", null, new { @class = "inpshort" })&lt;/dd&gt;
                  &lt;dt&gt;@Html.Label("Mededeling: ")&lt;/dt&gt;
                  &lt;dd&gt;@Html.TextBox("Message", null, new { @class = "inplong" })&lt;/dd&gt;
  
                  &lt;dd class="buttons"&gt;
                      &lt;input type="submit" value="Bevestigen" /&gt;
                      &lt;input type="submit" value="Annuleren" /&gt;
                  &lt;/dd&gt;
              }
          &lt;/dl&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>this is the Controller code:</p>
  
  <pre><code>        public ActionResult Transfer(int? id) {
              Holder h = Holder.GetHolderByHolderId(Convert.ToInt32(User.Identity.Name));
  
              List&lt;Account&gt; holderAccounts = Account.GetAccountsByHolderId(h.Id);
  
              List&lt;SelectListItem&gt; ddlHolderAccounts = new List&lt;SelectListItem&gt;();
              ddlHolderAccounts.Add(new SelectListItem { Text = "selecteer...", Value = "-1", Selected = true });
  
              foreach (Account acc in holderAccounts) {
                  if (acc.Id == id) {
                      ddlHolderAccounts.Add(new SelectListItem { Text = acc.Name, Value = acc.Id.ToString(), Selected = true });
                  } else {
                      ddlHolderAccounts.Add(new SelectListItem { Text = acc.Name, Value = acc.Id.ToString() });
                  }
              }
  
              ViewData["ddlAccounts"] = ddlHolderAccounts;
  
              return View();
          }
  
          [HttpPost]
          public ActionResult Transfer(Transaction tra) {
              if (ModelState.IsValid) {
                  Transaction.InsertTransaction(tra.Amount, tra.Message, tra.FromAccountId, tra.ToAccountNumber);
              }
  
              return View(tra);
          }
  </code></pre>
  
  <p>Now I searched a lot with Google, it's probably better to use the DropDownListFor to fill your drop down list? But could anyone show me an example?</p>