lau*_*ura 4 c# asp.net asp.net-mvc asp.net-mvc-3
我有一个Web流(asp.net),它有一个下拉菜单和一个复选框.
勾选复选框后,我需要禁用该表单中的某些字段.从复选框中选择特定值时,我需要禁用其他字段.
我指定了这样的复选框:
<%=Html.CheckBox("IsResponseUnavailable", Model.IsResponseUnavailable)%>
Run Code Online (Sandbox Code Playgroud)
和下拉这样:
<%= Html.MyDropDownList(string.Format("Questions[{0}].Answer", i), (IEnumerable<SelectListItem>)ViewData["Periods"], Model.Questions[i].Answer)%>
Run Code Online (Sandbox Code Playgroud)
其中MyDropDownList是Html.DropDownList的扩展
我听说过自动回发 - 但不确定如何使用它 - 任何建议都会很棒!
我正在使用ASP.NET MVC 3.
谢谢! - L.
Den*_*aub 10
<%= Html.CheckBox("IsResponseUnavailable", Model.IsResponseUnavailable,
new { onClick = "this.form.submit();" }) %>
<%= Html.MyDropDownList(string.Format("Questions[{0}].Answer", i),
(IEnumerable<SelectListItem>)ViewData["Periods"], Model.Questions[i].Answer),
new { onchange = "this.form.submit();" }) %>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10315 次 |
| 最近记录: |