title: Save Html Dropdownlist value after POST MVC
body: <p>I have a Dropdown list that is filled with data from my sql db, and i have a html form with POST everytime the user selects a option from my Dropdown list, however each time page refreshes i get my Dropdownlist default on screen instead of the last item the user picks how can i save the last value the user pics to stay on screen after a POST?</p>
  
  <p>This is my Viewbag:</p>
  
  <pre><code>foreach (var item in db.Pos.Select(l =&gt; l.Fecha).Distinct())
          {
             dateday = item.ToString("yyyy-MM-dd");
             lines = dateday.Split(' ')[0];
             listItem2.Add(lines);
          }
          var fechas = new SelectList(listItem2.ToList());
          ViewBag.Fechas = fechas;
  </code></pre>
  
  <p>And this is my View Code:</p>
  
  <pre><code> @using (Html.BeginForm("Index", "home/index", FormMethod.Post, new {id="some" }))
        { 
       &lt;input type="hidden" name="txtInput" value=""/&gt;
  
        @Html.DropDownList("Fechas", "Todas")
  
        &lt;input type="submit" name="test" value="Calcula Totales"/&gt;  
        }
  </code></pre>
  
  <p>I want the value of my ' @Html.DropDownList("Fechas", "Todas")' be the last one the user selects instead of the default "Todas"</p>