Mar*_*ijn 20 c# asp.net-mvc combobox autopostback
我正在使用asp.net MVC框架.在我的页面上我有一个dropdwonbox,当点击一个选项时,我想转到另一个页面.但我无法找到如何/在何处将autopostback属性设置为true.这是我正在使用的代码:
ASPX:
<%= Html.DropDownList("qchap", new SelectList( (IEnumerable)ViewData["qchap"], "Id", "Title" )) %>
控制器:
public ActionResult Index(int id)
{
    Chapter c =  new Chapter();
    ViewData["qchap"] = c.GetAllChaptersByManual(id);
    return View();
}
使用autopostback功能我需要做什么?
CMS*_*CMS 37
您可以使用onchange客户端事件:
<%= Html.DropDownList("qchap", 
       new SelectList( (IEnumerable)ViewData["qchap"], "Id", "Title" ),
       new { onchange = "this.form.submit();" }) %>
| 归档时间: | 
 | 
| 查看次数: | 27091 次 | 
| 最近记录: |