title: Why does this code changes location as I need it to
body: <p>I have a weird question. I have been writing a code to change the view by a <code>&lt;select&gt;</code>'s <code>onchange</code> like this:</p>
  
  <pre><code>&lt;% Html.BeginForm(); %&gt;
  &lt;label for="id" &gt;Automat:&lt;/label&gt;
  &lt;%= Html.DropDownList("id", Model as SelectList, new { @onchange = "window.location.href = document.getElementById('id').options[document.getElementById('id').selectedIndex].value;" })%&gt;
  &lt;% Html.EndForm(); %&gt;
  </code></pre>
  
  <p>The selected value is numeric (i.e. 1,2,...).</p>
  
  <p>Suddenly, I am able by changing the selected option to go from URL</p>
  
  <pre><code>http://localhost:58296/Content/ViewContent/2
  </code></pre>
  
  <p>to </p>
  
  <pre><code>http://localhost:58296/Content/ViewContent/3
  </code></pre>
  
  <p>.. And I really don't know why it works. Can anyone explain that to me please?</p>