title: .net mvc select list handle on selected item event
body: <p>I am quite new to this net mvc thing. to understand what I am trying to do I will put an example. <br/>
  <strong>Example</strong> <br/>
  I have a list of clients that contains data and in my view I used a <code>&lt;select&gt;</code> with a <code>foreach</code> that goes through all the clients to show the data. What I am trying to do is, when a user selects a client name he would be redirected to another page where that page would get the client name as a parameter &amp; do stuff with that. <br/>
  I tried this but I am stuck in a part</p>
  
  <pre><code>&lt;select&gt;
      @foreach (var item in Model.clients)
      {
          &lt;option&gt;
              @Html.Encode(item.name)
          &lt;/option&gt;
      }
  &lt;/select&gt;
  </code></pre>
  
  <p>I know how to redirect from page A to page B like this <code>RedirectToAction(...)</code> <br/> what I want to do is handle that select action to call the method in my controller &amp; use that method to send a parameter to page B 
  <br/> <br/>
  <strong>UPDATE</strong> <br/></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function Fct() {
          var v = arguments[0]; //get The ID in the parameter
          window.location.href = "@Url.Action("Index", "PageB")?client_id=" + v;
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>I tried both lists and the one proposed by @Shyui is easier but i wanted to try something with this one</p>
  
  <pre><code>&lt;select id="clients_list" onchange="Fct(this.value)"&gt;
      &lt;option class="placeholder" selected disabled value="-1"&gt;Select Name&lt;/option&gt; &lt;!-- Can't be selected --&gt;
      @foreach (var item in Model.clients)
      {
          &lt;option value="@item.ID"&gt;
              @Html.Encode(item.name)
          &lt;/option&gt;
      }
      &lt;option value="0"&gt;New Client&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>