Click here to Skip to main content
15,914,111 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
In Visual Studio 2013 , when creating an ASP.NET MVC project ,there used to be a BundlesConfig.cs file in App_Data folder. I could replace the traditional Bootstrap.css file with any theme of my choice from bootswatch.com site?
How do i achieve the same result in Visual studio 2019?


PS: I was able to find bootstrap.css file somehow. Can someone give me a document on how to create MVC app in visual studio 22019 by adding themes.

What I have tried:

Tried going through Microsoft Documents.But to no help.
Posted
Updated 28-Oct-19 8:55am

This problem is not related to Visual Studio, rather ASP.NET, and specifically MVC framework of ASP.NET—and I am sure the non-.NET Core version.

Quote:
Can someone give me a document on how to create MVC app in visual studio 22019
The problem is same in both the IDEs, they are not much different. Make sure that you have downloaded and installed the Web development stack for Visual Studio 2019—yes, Visual Studio 2019 focuses on the stacks, and not the SDKs only.

See here for more on that, Modern Web Tooling | Visual Studio - Visual Studio[^]

Creating the ASP.NET MVC based project is also possible, as long as you download the .NET framework as well as the web development SDKs, and next steps are same; File → New Project → ASP.NET MVC.

Quote:
I was able to find bootstrap.css file somehow.
Linking any CSS file is done the same way as you would add any CSS file, <link>: The External Resource Link element - HTML: Hypertext Markup Language | MDN[^].

I would highly recommend since you are learning, that you start with .NET Core, as that provides a more control on the development, as well as the deployment for your application. Bootstrap and other front-end technologies are integrated right out of box, and many samples are provided that provide Angular or React samples that you can start with.

You can also use the CDN based instance of Bootswatch[^] and use the CDN alternatives, rather than downloading the files to your machine—which might decrease the development experience as the resources would not be available for development if network goes down.
 
Share this answer
 
I will rephrase my question.
Here is the scenario.
In visual Studio 2013, we have the facility to put the files like bootstrap-lumen.css or any other css file in BundlesConfig.cs class. So if I am adding let's say bootstrap-lumen bootstrap-slate.css(themes downloaded from bootswatch) in the solution explorer under CONTENT folder. Then this could be referenced under the BundlesConfig.cs to let the compiler know that this is css file(
bootstrap-slate.css
) to be loaded.
Now this can achieved in VISUAL STUDIO 2019 by going to view folder-->shared--> open _Layouts.cshtml.. Go to
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap-slate.css" />

Replace the "bootstrap-lumen" with your css file name.Build and execute and vola.. I get my theme.!!!!


In VS2017..you will get the same thing in emvironment tags.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900