1.4.1.The Markup (labelFor, textbox, checkbox)

  • The statement @using (Html.BeginForm()) and Boostrap will understand the markup in this scope:

@using (Html.BeginForm("Create", "Customers"))
{
    <div class = "form-group">
        @Html.LabelFor(m => m.Name)
        @Html.TextBoxFor(m => m.Name, new {@class = "form-control"})
    </div>
    <div class="form-group">
        @Html.LabelFor(m => m.Birthday)
        @Html.TextBoxFor(m => m.Birthday, new { @class = "form-control" })
    </div>
    <div class="checkbox">
        <label>
            @Html.CheckBoxFor(m => m.IsSubscribeToNesletter) Subscribed to Newsletter
        </label>
    </div>
}

Last updated