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