Form-Horizo​​ntal类的MVC Bootstrap问题

时间:2018-03-15 10:27:17

标签: asp.net vb.net model-view-controller bootstrap-4

我是VB / Net MVC和BootStrap的新手。任何人都可以建议为什么Form-Horizo​​ntal类没有在以下代码中应用。它嵌套在@Using(Html.BeginForm())标记

@<div class="form-horizontal">
    <h4>Team</h4>
    <hr />
    @Html.ValidationSummary(True, "", New With {.class = "text-danger"})
    @Html.HiddenFor(Function(model) model.id)


    <div class="form-group">
        @Html.LabelFor(Function(model) model.Name, htmlAttributes:=New With {.class = "col-sm-2 control-label "})
        <div class="col-sm-10">
            @Html.EditorFor(Function(model) model.Name, New With {.htmlAttributes = New With {.class = "form-control"}})
            @Html.ValidationMessageFor(Function(model) model.Name, "", New With {.class = "text-danger"})
        </div>
    </div>

    <div class="form-group">
        @Html.LabelFor(Function(model) model.Stadium, htmlAttributes:=New With {.class = "col-sm-2 control-label"})
        <div class="col-sm-10">
            @Html.EditorFor(Function(model) model.Stadium, New With {.htmlAttributes = New With {.class = "form-control"}})
            @Html.ValidationMessageFor(Function(model) model.Stadium, "", New With {.class = "text-danger"})
        </div>
    </div>

    <div class="form-group">
        @Html.LabelFor(Function(model) model.League_id, "League_id", htmlAttributes:=New With {.class = "col-sm-2 control-label"})
        <div class="col-sm-10">
            @Html.DropDownList("League_id", Nothing, htmlAttributes:=New With {.class = "form-control"})
            @Html.ValidationMessageFor(Function(model) model.League_id, "", New With {.class = "text-danger"})
        </div>
    </div>

    <div class="form-group">
        @Html.LabelFor(Function(model) model.Visited, htmlAttributes:=New With {.class = "col-sm-2 control-label"})
        <div class="col-sm-10">
            @Html.EditorFor(Function(model) model.Visited, New With {.htmlAttributes = New With {.class = "form-control Checkbox"}})
            @Html.ValidationMessageFor(Function(model) model.Visited, "", New With {.class = "text-danger"})
        </div>
    </div>

    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
            <input type="submit" value="Save" class="btn btn-primary btn-sm" />
        </div>
    </div>
</div>

Current result is

感激不尽的任何帮助。

0 个答案:

没有答案