twitter-bootstrap 如何将引导程序模板添加到 ASP.net MVC 项目

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/36935675/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 23:53:09  来源:igfitidea点击:

how to add bootstrap template to ASP.net MVC project

asp.net-mvctwitter-bootstraptemplates

提问by Zogre

I want to create a ASP.net MVC5 project by using bootstrap template like this one "https://colorlib.com/polygon/metis/dashboard.html#". I have download it by my browser but i don't know how to add it to my project in visual studio 2013. I have not find a tuto that help to do that, i just find how to add theme. May someone know how to do it or a tuto that can show me the way?

我想通过使用像这样的引导程序模板“ https://colorlib.com/polygon/metis/dashboard.html#”来创建一个 ASP.net MVC5 项目。我已经通过浏览器下载了它,但我不知道如何在 Visual Studio 2013 中将它添加到我的项目中。我没有找到帮助做到这一点的教程,我只是找到了如何添加主题。可能有人知道怎么做或可以给我指路的教程吗?

Thanks a lot

非常感谢

回答by Joan Gil

1.- Create a new project with the MVC structure. Bootstrap and jQuery are already installed.

1.- 创建一个具有 MVC 结构的新项目。Bootstrap 和 jQuery 已经安装。

The folder structure should look like this:

文件夹结构应如下所示:

Project structure

项目结构

2.- Add your downloaded css in the Content folder

2.- 在 Content 文件夹中添加您下载的 css

3.- Add your downloaded js in the Scripts folder

3.- 在 Scripts 文件夹中添加您下载的 js

4.- Add your html files in differents view folders depending on what you want. You should put the common html elements of all the page in the _Layout page (e.g. Menu or Top bar).

4.- 根据您的需要在不同的视图文件夹中添加您的 html 文件。您应该将所有页面的公共html 元素放在_Layout 页面(例如Menu 或Top bar)中。

Hope it helps!

希望能帮助到你!

回答by umang uliana

Create a Bootstrap class inside the Content folder and name it

在 Content 文件夹中创建一个 Bootstrap 类并命名

bootstrap-anything.css    

App Start folder contains configuration files. The folder should contain 3 files:

App Start 文件夹包含配置文件。该文件夹应包含 3 个文件:

BundleConfig.cs     
FilterConfig.cs       
RouteConfig.cs    

Go inside BundleConfig.cs, there should be a function

进入 BundleConfig.cs,应该有一个函数

bundes.Add(new StyleBundle("~/Content/css").Include(
"~/Content/bootstrap.css",
"~/Content/site.css"));    

Change

改变

~/Content/bootstrap.css  to   ~/Content/bootstrap-anything.css    

That's it.

而已。