Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you make visual studio scaffold etc. with bootstrap 4 in .NET MVC templates?

When you create a new project in vs17 (basic mvc .net web application in c#). It comes with bootstrap 3, which means all the scaffolded pages and designs are wrong since they revamped the column sizing system.

Is there any way VS can be updated so it scaffolds etc. correctly after updating a project to bootstrap v4? Or is there going to be an update at some point for this change?

like image 284
ObedMarsh Avatar asked Jan 31 '18 16:01

ObedMarsh


People also ask

Can we use bootstrap in MVC?

Since Bootstrap is all HTML, CSS and JavaScript, all open standards, you can use it with any framework including ASP.NET MVC.

How can you create a scaffold template in MVC?

First, let's use default templates to scaffold a controller and CRUD views for the Product model so we can review the results. To do so, right-click the Controllers folder in Solution Explorer and click Add New Scaffolded Item. In the Add Scaffold dialog, choose the MVC 5 Controller with views, using Entity Framework.

What are scaffold templates in ASP.NET MVC?

Scaffold templates are used to generate code for basic CRUD operations within your ASP.NET MVC applications against your database with the help Entity Framework. These templates use the Visual Studio T4 templating system to generate views for basic CRUD operations with the help of Entity Framework.

How do I add a bootstrap template to Visual Studio?

To install the Bootstrap Snippet Pack, from Visual Studio, go to Tools, then Extensions and Updates > Online > Search Bootstrap Snippet Pack. Once Installed, from Visual Studio editor, hit CTL+K, CTL+X to bring in the snippet tool. Then select Bootstrap and the component needed.


Video Answer


1 Answers

I ran into this same question when using a VS17 asp.net core mvc scaffold. With a little digging I was able to find a tutorial that walks you through updating bootstrap and jquery (Scroll about a third of the way down the page to the 'Upgrade Bootstrap Through Bower Package' section):

http://www.mytecbits.com/microsoft/dot-net/bootstrap-asp-net-core-mvc

Additionally, it is possible to create custom scaffolds with more modern versions of bootstrap. If you find yourself needing to update this often, it may be worth looking into that.

like image 58
Ryan Gibbs Avatar answered Oct 05 '22 17:10

Ryan Gibbs