Bootstrap in ASP.NET MVC 5

时间:2023-10-07 10:02:32

一,新建ASP.NET MVC 5 项目

Bootstrap in ASP.NET MVC 5

Bootstrap in ASP.NET MVC 5

Bootstrap 文件分布

Bootstrap in ASP.NET MVC 5

引入到页面

1、定义。注意:不要包含有.min.的文件名称,会被忽略,因为在发布的时候编译器会加载min版的文件

Bootstrap in ASP.NET MVC 5

2、在母版页中引用上面的定义

Bootstrap in ASP.NET MVC 5

最后一步,程序启动时加载定义的绑定

Bootstrap in ASP.NET MVC 5


启用压缩js,css

Bootstrap in ASP.NET MVC 5

运行后看页面源码:

Bootstrap in ASP.NET MVC 5

压缩前时这样的:

Bootstrap in ASP.NET MVC 5