【发布时间】:2013-03-20 07:24:17
【问题描述】:
我有一个下拉列表,它需要在控制器上使用其 OnChange 事件中所选下拉列表值的参数值调用一个操作。
这就是我现在拥有的。
<%= Html.DropDownList("series",
new SelectList((IEnumerable)ViewData["series"], "ProductId", "SeriesName"),
new { onchange = "??" })%>
我可以将列表包含在表单元素中
<form id="SeriesForm" action="<%: Url.Action("S", "ProductSearch", new {SeriesId = ?? }) %>" method="post">
但是如何设置 SeriesId 参数,它应该是下拉列表的选定值?我尝试将 jQuery 方法附加到 OnChange 事件,但我无法更改 Url.Action 方法。
谢谢,
【问题讨论】:
标签: jquery asp.net-mvc drop-down-menu