应用JS 限制右边显示选择10项功能
<div class="row">
<div class="col-xs-5">
<select name="from" id="multiselect" class="multi-select form-control" size="8" multiple="multiple">
@{
List<BasicEffect> basicEffecf = ViewBag.GetBasicEffectList;
if (basicEffecf != null)
{
foreach (var items in basicEffecf)
{
if (items.DeleteFlag==false)
{
<option value="@items.ID" >@items.EffectName.ToString()</option>
}
}
}
}
</select>
</div>
<div class="col-xs-2">
<button type="button" id="multiselect_rightAll" class="btn_1 default"><i class="glyphicon glyphicon-forward"></i></button>
<button type="button" id="multiselect_rightSelected" class="btn_1 default"><i class="glyphicon glyphicon-chevron-right"></i></button>
<button type="button" id="multiselect_leftSelected" class="btn_1 default"><i class="glyphicon glyphicon-chevron-left"></i></button>
<button type="button" id="multiselect_leftAll" class="btn_1 default"><i class="glyphicon glyphicon-backward"></i></button>
</div>
<div class="col-xs-5">
<select name="BasicEffect" id="multiselect_to" class="multi-select form-control" size="8" multiple="multiple">
</select>
@Html.ValidationMessageFor(model=>model.BasicEffect,"",new { @class = "text-danger" })
</div>
</div>
foreach的时候给个长度不可以吗
自己已经解决了