3
I would like a tip on how to put two fields on the same line in Razor, using bootstrap in an ASP.NET MVC5 application.
div class="ibox-content">
<form role="form" class="form-inline">
<div class="form-group">
@Html.LabelFor(model => model.Nm_EquipeMinima, new { @class = "control-label col-md-2" })
<div class="col-md-6">
@Html.EditorFor(model => model.Nm_EquipeMinima)
@Html.ValidationMessageFor(model => model.Nm_EquipeMinima)
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.Nr_EquipeMinima, new { @class = "control-label col-md-2" })
<div class="col-md-6">
@Html.EditorFor(model => model.Nr_EquipeMinima)
@Html.ValidationMessageFor(model => model.Nr_EquipeMinima)
</div>
</div>
</form>
</div class="ibox-content">
This is my code and below the result.
In
divs
from the inside, there are still 4 more spaces each that can be used. This way it is half ugly because the blocks will be aligned to the left.– Leonel Sanches da Silva
but the label is on top of the input, so it would just change the div col-Md-6 to 12 and take the form-inline there looks pretty :)
– Pablo Tondolo de Vargas