【发布时间】:2017-04-15 07:35:28
【问题描述】:
刚接触这类工作,需要你的帮助
在我看来.cshtml ----
<table class>
<thead>
<tr>
<th >@Html.CheckBox("IsAllRowSelected")</th>
<th >
@Html.DropDownListFor(m => m._dropDownForcolumn2, new List<SelectListItem>
{ new SelectListItem{Text="option1", Value="option1"},
new SelectListItem{Text="option2", Value="option2"},
new SelectListItem{Text="option3", Value="option3"}
}, new {@id="dropDownForcolumn2" })
</th>
<th>@Html.Label(" column 3 ")</th>
<th>@Html.Label("column 4")</th>
<th>@Html.Label("column 5")</th>
</tr>
</thead>
<tbody>
@foreach (Models.MyModelClass item in Model._List)
{
<tr>
<td>@Html.CheckBox("IsEachRowSelected")</td>
<td>@item.Option1Values</td>
@*//@item.option2values;
@item.option3vlaues;*@
<td>@item.column3value</td>
<td>@item.column4value</td>
<td>@item.column5value</td>
</tr>
}
1 .cant 再次发回控制器以仅获取此列值。它只是一个大页面中的一个小表 2 我已经在项目中有其他值 现在只有 option1 值出现在列中,要求是绑定第 2 列与标题下拉列表并选择第 2 个选项,然后这将显示@item.option2values 和第 3 个选项,然后将显示@item.option3values
其他栏目不会改变或触摸。
类似的东西
<td>
if(dropdownvalue = option1)
@item.Option1Values
elseif(dropdownvalue == option2 )
@item.option2values
elseif(dropdownvalue == option2 )
@item.option3vlaues
</td>
ajax , jquery 是允许的,但不允许整页发布或部分视图发布
【问题讨论】:
标签: c# asp.net-mvc asp.net-mvc-4 razor asp.net-ajax