【发布时间】:2014-06-14 18:37:37
【问题描述】:
我需要知道从下拉列表中选择了哪个项目 我怎么知道@Html.DropDownList (....) 因为我需要在查询“if (...)”中使用下拉列表的值“文本”
示例:
<div class="editor-label">
<span>Enviar una Notificacion a...</span><br />
<span>@Html.DropDownList("Value", ViewBag.ComboEnviar as IEnumerable<SelectListItem>, "Seleccione una opción")</span>
</div>
....
@if (@Html.DropDownList(...).SelectValue == 0)
{
<label for="descripcion">@Html.LabelFor(model => model.nameUsuario)</label>
}
【问题讨论】: