title: How to pass value of selected dropdown list from View to Controller in MVC
body: <p>Hi i need some help on MVC as new in this area. Here is my code for Dropdown list and I just want to get the selected values by user in a controller so that I can pass that value to a table in db. Here is the code from .cshtml</p>
  
  <pre><code>@Html.DropDownList("LogOffTime", new List&lt;SelectListItem&gt;
  {
      new SelectListItem{ Text="One", Value = "30000" },
      new SelectListItem{ Text="Two", Value = "60000" },
      new SelectListItem{ Text="Three", Value = "180000" }
  }, "Select Time") 
  </code></pre>
  
  <p>Controller: </p>
  
  <pre><code> public ActionResult Index()
   {How to get the value from drop down list}
  </code></pre>
  
  <p>I just need to know how to access the value i.e. the 30000/60000 etc. in controller. Also need to check that no value will be passed if the user does not select anything. Also correct me pls. if anything wrong in my code. Thanks!</p>