면도기 뷰에 DropDownList 및 TextArea가 있습니다. 드롭 다운의 특정 값을 선택한 경우에만 TextArea를 표시해야합니다. 그 해결책은 무엇입니까? 지금까지 시도한 것은 있지만 보안 유형의 값이 설정되어 있다고 가정하기 때문에 적절하지 않습니다.동일한보기에서 MVC 드롭 다운 선택한 값으로
<tr>
<td style="width: 200px; height: 30px">
@Html.LabelFor(model => model.SecurityTypeId)
</td>
<td style="width: 400px; height: 30px">
@Html.DropDownListFor(model => model.SecurityTypeId, Model.SecurityTypes, dropdownHtmlAttrs)
</td>
<td> </td>
</tr>
<tr>
@if (Model.SecurityTypeId == (int)(SecurityType.Other))
{
<td style="width: 200px; height: 30px">
@Html.LabelFor(model => model.Details)
</td>
<td style="width: 400px; height: 30px">
@Html.TextAreaFor(model => model.Details, new { Style = "width:240px" })
</td>
<td> </td>
}
</tr>
당신은 자바 스크립트/jQuery를해야합니다. –