title: How do you submit a dropdownlist in asp.net mvc from an Ajax form
body: <p>How do you submit from a dropdownlist "onchange" event from inside of an ajax form?</p>
  
  <p>According to the following question: <a href="https://stackoverflow.com/questions/364505/how-do-you-submit-a-dropdownlist-in-aspnet-mvc">How do you submit a dropdownlist in asp.net mvc</a>, from inside of an Html.BeginFrom you can set onchange="this.form.submit" and changing the dropdown posts back.</p>
  
  <p>However, using the following code (inside an Ajax.BeginFrom):</p>
  
  <pre><code>&lt;% using (Ajax.BeginForm("UpdateForm", new AjaxOptions() { UpdateTargetId = "updateText" })) { %&gt;
      &lt;h2&gt;Top Authors&lt;/h2&gt;
  
      Sort by:&amp;nbsp;&lt;%=Html.DropDownList("sortByList", new SelectList(ViewData["SortOptions"], new { onchange = "this.form.submit()" })%&gt;
  
      &lt;%= Html.TextBox("updateText")%&gt;
  &lt;% } %&gt;
  </code></pre>
  
  <p>Posts back to the controller action, but the entire page is replaced with the contents of the "updateText" text, rather than just what is inside the "updateText" textbox.</p>
  
  <p>Thus, rather than replacing just the area inside the Ajax.BeginForm, the entire page is replaced.</p>
  
  <p>What is the correct way for the dropdownlist to call this.form.submit such that only the area inside the Ajax.BeginForm?</p>