title: Get Selected Item from dropdown and pass it to an onClick event
body: <p>I'm trying to get <strong>Selected Item</strong> from drop down list populated by SQL db and pass it to an onclick event of a button</p>
  
  <pre><code>&lt;th&gt;Select Club&lt;/th&gt;
  &lt;td&gt;@Html.DropDownList("Clubs", new SelectList(Model.Clubs.Select(x =&gt; x.Name)), "Select Club")&lt;/td&gt;
  
  &lt;input type="button" onclick="AssignPlayertoClub(@Model.Player.ID,"Clubs.SelectedValue")"/&gt; //&lt;-- Selected Value here
  </code></pre>
  
  <p>So signature of <strong>AssignPlayertoClub(ID,Club)</strong> is this. I read a lot of answers on this issue but nothing fixes mine as most of them use Viewbag</p>
  
  <p>This is my method in <strong>Controller</strong> Method to be called onClick</p>
  
  <pre><code> [HttpPost]
      public async Task&lt;ActionResult&gt; AssignPlayertoClub(int ID,Club club)
      {
          await playerRepo.AssignPlayer(ID, club);
          return RedirectToAction("Index");
      }
  </code></pre>
  
  <p>I'm using JQuery Ajax to call the controller method like this</p>
  
  <pre><code>function AssignPlayertoClub(Id, club) {
  $.ajax({
      url: '/Player/AssignPlayertoClub',
      type: 'POST',
      data: { Id: Id, club: club },
      success: function (data) {
          window.location.href = data;
      }
  }).done(() =&gt; alert("Player Assigned"));
  }
  </code></pre>
  
  <p>If any other code is required. Let me know</p>