title: DropDown list onchange event and AJAX in MVC
body: <p>I have a code block in my MVC view as follows:</p>
  <pre><code>&lt;%using (Ajax.BeginForm(&quot;MyAction&quot;, new { action = &quot;MyAction&quot;, controller = &quot;Home&quot;, id = ViewData[&quot;selected&quot;].ToString() }, new AjaxOptions { UpdateTargetId = &quot;Div1&quot; }))
       { %&gt;
            &lt;%=Html.DropDownList(&quot;ddl&quot;, ViewData[&quot;MyList&quot;] as SelectList, new { onchange = &quot;this.form.submit()&quot; })%&gt;
                   &lt;%} %&gt;
  </code></pre>
  <p>I want to set the value of ViewData[&quot;selected&quot;] so that i can send it to the desired action.
  Can anyone please suggest how can i do this?</p>
  <p>thanks!</p>