asp.net mvc - Twitterbootstrap input-groups with Razor syntax -
asp.net mvc - Twitterbootstrap input-groups with Razor syntax -
i'm trying convert html
:
<div class="col-lg-6"> <div class="input-group"> <span class="input-group-addon"> <input type="checkbox"> </span> <input type="text" class="form-control"> </div><!-- /input-group --> </div><!-- /.col-lg-6 -->
into razor
syntax this:
<div class="col-lg-6"> <div class="input-group"> <span class="input-group-addon"> @html.checkboxfor(model => model.negotiable, new { @class = "form-control", @checked = "checked" }) </span> @html.textboxfor(model => model.price, new { id = "price", @class = "form-control", }) </div><!-- /input-group --> </div><!-- /.col-lg-6 -->
but result get:
on left see vertical gray thing should have displayed checkbox.
what missing?
given illustration html in question correct. razor equivalent of it.
razor
<div class="col-lg-6"> <div class="input-group"> <span class="input-group-addon"> @html.checkboxfor(model => model.negotiable, new { @checked = "checked" }) </span> @html.textboxfor(model => model.price, new { id = "price", @class = "form-control", }) </div><!-- /input-group --> </div><!-- /.col-lg-6 -->
the difference is, have removed class form-control
@html.checkboxfor
not required.
asp.net-mvc razor checkbox textbox twitter-bootstrap-3
Comments
Post a Comment