I have this code:
<div class="editor-label">
@Html.LabelFor(model => model.Ticket)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Ticket)
@Html.ValidationMessageFor(model => model.Ticket)
</div>
How do I get the label and checkbox(in this case its a checkbox) on the same line? I have tried removing the divs and they still come out on different lines.
Thank you.
Removing the didn't work for my app, but adding new { @style = "display:inline-block" }
as the second argument on the LabelFor()
did.
I prefer the checkbox before the label so it would be:
<div>
@Html.EditorFor(model => model.GetAll)
@Html.LabelFor(model => model.GetAll, new { @style = "display:inline-block" })
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With