<% using (Html.BeginForm() { %>
<%=Html.DropDownList("TopItemsList", ViewData["ListData"], new { onchange="[???]" })%>
<% } %>
En el ejemplo anterior, ¿qué valor debe establecer en el cambio? O bien, ¿cómo se obtiene la forma correcta?¿Cómo se envía una lista desplegable en asp.net mvc
¿Hay alguna diferencia con Ajax.BeginFrom?
Sólo para corregir la declaración, <% = Html.DropDownList ("TopItemsList", ViewData [ "ListData"], nueva {@ onchange =" this.form.submit(); "})%> tenga en cuenta el símbolo @. –
Si tiene varias listas desplegables o cuadros de texto que necesita hacer esto también, creé una clase de CSS y agregué este JS. $ (". AjaxForcePost"). Change (function() { this.form.submit(); }); – bulltorious