title: Get Selected Value of Dropdownlist in ActionLink (MVC 5)
body: <p>I am trying to get the selected value of a dropdownlist in @Html.ActionLink but no luck so far. Requirement is to dynamically retrieve a table and have a dropdown list for actions that can be taken against the row. I need to select an action and then on hitting submit button, row ID and selected action value should be posted to the controller. Here is the piece of code I have in place.</p>
  
  <pre><code>@foreach (AdsViewModel ad in Model)
  {
    &lt;tbody&gt;
       &lt;tr&gt;
  
           &lt;td&gt;@ad.Row_Id&lt;/td&gt;
           &lt;td class=" "&gt; @ad.Description &lt;/td&gt;
           &lt;td class=" "&gt; @ad.Valid_To.ToShortDateString() &lt;/td&gt;
           &lt;td&gt;&lt;span class="label label-sm label-success label-mini"&gt; @ad.Status &lt;/span&gt;&lt;/td&gt;
           &lt;td&gt;@Html.DropDownList("actions", ad.Actions) &lt;/td&gt;
           &lt;td&gt;@Html.ActionLink("Submit", "AdAction", new {adId = ad.Row_Id, action = ad.Actions.SelectedValue}) &lt;/td&gt;
       &lt;/tr&gt;
     &lt;/tbody&gt;
  </code></pre>
  
  <p>}</p>
  
  <p>On clicking the Submit ActionLink, I am getting the adId but no action is returned from the dropdownlist.</p>
  
  <p>Your help is much appreciated.
  Edit: Here is the AdsViewModel</p>
  
  <pre><code>public class AdsViewModel
  {
      public string Row_Id { get; set; } //Transaction Number
      public string Description { get; set; } //Trasaction Description
      public DateTime Valid_To { get; set; } //Expiry
      public string Status { get; set; } //Object Status Code
      public SelectList Actions { get; set; }
  }
  </code></pre>
  
  <p>This is how the Select list is filled in Controller </p>
  
  <pre><code>List&lt;SelectListItem&gt; items = new List&lt;SelectListItem&gt;();
  items.Add(new SelectListItem() { Text = "View", Value = "001" });
  items.Add(new SelectListItem(){Text = "Modify", Value = "002"});
  model.Actions = items;
  </code></pre>