title: Handling onchange event in HTML.DropDownList Razor MVC
body: <p>I'm handling an <code>onchange</code> event with a selected value by simple HTML like this: </p>
  
  <pre><code>&lt;select onchange="location = this.value;"&gt;
           &lt;option value="/product/categoryByPage?PageSize=15" selected="selected"&gt;15&lt;/option&gt;
           &lt;option value="/product/categoryByPage?PageSize=30" selected="selected"&gt;30&lt;/option&gt;
           &lt;option value="/product/categoryByPage?PageSize=50" selected="selected"&gt;50&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>Doing it like this:</p>
  
  <pre><code>List&lt;SelectListItem&gt; items = new List&lt;SelectListItem&gt;();
  string[] itemArray = {"15","30","50"};
  
  for (int i = 0; i &lt; itemArray.Count(); i++)
  {
      items.Add(new SelectListItem 
      { 
          Text = itemArray[i], 
          Value = "/product/categoryByPage?pageSize=" + itemArray[i]
      });
  }
  
  ViewBag.CategoryID = items;
  @Html.DropDownList("CategoryID")
  </code></pre>
  
  <p>How can I handle <code>onchange</code> with <code>@Html.DropDownList()</code></p>