我刚刚将我的Visual Studio 2017 ASP.NET MVC 5应用程序从Bootstrap v3更新到v4.我发现当我使用脚手架添加新的编辑局部视图时,它仍然使用表单的Bootstrap v3 CSS类名.有没有办法更新脚手架使用BS v4?
编辑
我正在谈论的内容似乎有些混乱.在Visual Studio 2017中,在MVC项目的"解决方案资源管理器"中,右键单击"视图"文件夹>"添加">"查看...">"MVC 5视图">"单击添加".这将打开"添加视图"对话框.我键入我的视图名称,选择编辑模板,然后选择,Views folder > Add > View... > MVC 5 View > Click Add作为Model类.Visual Studio生成此标记.这个过程叫做脚手架.
@model Demo.ViewModels.LoginVm
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<div class="form-horizontal">
<h4>LoginVm</h4>
<hr />
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
<div class="form-group">
@Html.LabelFor(model => model.UserName, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.UserName, new { htmlAttributes = new { @class = "form-control" } }) …Run Code Online (Sandbox Code Playgroud) asp.net-mvc asp.net-mvc-scaffolding asp.net-mvc-5 bootstrap-4 visual-studio-2017