Here on Stackoverflow i find solution for checkbox with label like this:
<div class="checkbox">
<label>@Html.CheckBoxFor(x => item.IsSelected) @Html.DisplayNameFor(x => item.IsSelected)</label>
</div>
Also, it's recomended solution on bootstrap but, how to set few checkbox in the same class and to set them in-line...
I tryed something like this, but, obvios it's just set checkboxes vertically...
<div class="checkbox">
<label>@Html.CheckBoxFor(x => x.Temperature) @Html.DisplayNameFor(x => x.Temperature)</label>
</div>
<div class="checkbox">
<label>@Html.CheckBoxFor(x => x.Pressure) @Html.DisplayNameFor(x => x.Pressure)</label>
</div>
<div class="checkbox">
<label>@Html.CheckBoxFor(x => x.Humidity) @Html.DisplayNameFor(x => x.Humidity)</label>
</div>
<div class="checkbox">
<label>@Html.CheckBoxFor(x => x.TemperatureLocal) @Html.DisplayNameFor(x => x.TemperatureLocal)</label>
</div>
<div class="checkbox">
<label>@Html.CheckBoxFor(x => x.HumidityLocal) @Html.DisplayNameFor(x => x.HumidityLocal)</label>
</div>
<div class="checkbox">
<label>@Html.CheckBoxFor(x => x.CO2) @Html.DisplayNameFor(x => x.CO2)</label>
</div>
<div class="checkbox">
<label>@Html.CheckBoxFor(x => x.Illumination) @Html.DisplayNameFor(x => x.Illumination)</label>
</div>
Aucun commentaire:
Enregistrer un commentaire