I have a razor view and using bootstrap-multiselect.css. I am showing checkboxes but i cant make checkboxes checked with my code. Thanks for answers.
<select name="@cat.Title" id="catandsubcat" multiple="multiple" class="form-control">
@foreach (SubCategoryVM subcat in cat.SubCategoryVM)
{
<option value="@subcat.Id" @(Model.Any(x => x.SubCategory_Id == subcat.Id)) : "checked" : "" }>
@subcat.Title
</option>
}
</select>
My browser renders this.
<li class="checkList active"><a tabindex="0">
<div class="aweCheckbox aweCheckbox-danger">
<input type="checkbox" value="2" id="multiselect-1">
<label for="multiselect-1" class="checkbox">Peyzaj</label>
</div>
</a>
</li>
Aucun commentaire:
Enregistrer un commentaire