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?
Since Bootstrap is all HTML, CSS and JavaScript, all open standards, you can use it with any framework including ASP.NET 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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With