title: Redirect to MVC ActionResult with Parameters when DropDownList option is changed
body: <p>I am using MVC to create part of a website. In one of my Views I have a <code>DropDownList</code>. When a new drop down list option is selected, or in other words <code>onchange</code>, I want my page to be redirected to a specific Controller <code>ActionResult</code>. I am able to get to <code>MyAction</code> ActionResult if there are no parameters, however I can't figure out how to send in the needed parameters.</p>
  
  <p>My Controller Action:</p>
  
  <pre><code>public virtual ActionResult MyAction(int param1, int param2)
  {
      return View();
  }
  </code></pre>
  
  <p>My DropDownList in View:</p>
  
  <pre><code>@Html.DropDownList(
          "viewDataItem", Model.MyEnumerableList as SelectList, 
          new { onchange = @"
              var form = document.forms[0];
              form.action='MyAction';
              form.submit();" 
          } )
  </code></pre>
  
  <p>The above code calls MyAction, however it does not send in the parameters. Is there a way to somehow add the parameters to this code?  </p>
  
  <p>Another thought was to somehow use <code>@{Response.Redirect(@Url.Action("MyAction", "myController", new { param1 = 2, param2= 3 }));}</code> as my DropDownList action since Response.Redirect allows me to redirect to MyAction with parameters. Is there a way to somehow make onchanged =  Response.Redirect? </p>
  
  <p>The tried making onchange equal the response, but the nothing happens when I change my option:</p>
  
  <pre><code>@Html.DropDownList(
          "name", Model.MyEnumerableList as SelectList,
          new
          {
              onchange = {Response.Redirect(@Url.Action("MyAction", "controllerName", new { param1 = 5, param2 = 3 }));}
          })
  </code></pre>
  
  <p>In short, how do I call an ActionResult with parameters whenever my DropDownList option is changed?</p>
  
  <p>Similar questions were asked <a href="https://stackoverflow.com/questions/1530850/redirect-to-controller-view-when-dropdownlist-changed">here</a> and <a href="https://stackoverflow.com/questions/15332225/checkbox-oncheck-redirect-to-actionresult-in-mvc">here</a>, but the answers provide in those links all use JavaScript and I don't know how to use JS with cshtml. I tried some of those answers, but none of them solved my problems.</p>