Asp.Net MVC Razor BootStrap Input Form

前端 未结 2 2227
野性不改
野性不改 2021-02-20 15:40

Currently I have an Input form like this:

@Html.LabelFor(model => model.VenueID)
相关标签:
2条回答
  • 2021-02-20 16:06
    <div class="form-group">
        @Html.LabelFor(model => model.VenueID, new { @class = "sr-only", @for = "txtVenueID" })
        @Html.TextBoxFor(model => model.VenueID, new { @class = "form-control", @placeholder = "ID:" , @id="txtVenueID" })
        @Html.ValidationMessageFor(model => model.VenueID)
    </div>
    
    0 讨论(0)
  • 2021-02-20 16:06

    You can add CSS classes using Razor syntax as shown below. All you need to do is specify the Bootstrap class(es) you want to use.

    <div class="editor-field">
        @Html.TextBoxFor(model => model.VenueID, new { @class = "form-control" })
        @Html.ValidationMessageFor(model => model.VenueID)
    </div>
    
    0 讨论(0)
提交回复
热议问题