Answered by:
Implement StartBootstrap template on Asp.Net Core 2.0

Question
-
User1073717099 posted
Greetings.
I am struggling to implement this bootstrap template on my Asp.Net Core (Razor Page, not MVC) project. I am following every tutorial and every how-to article but it just doesn't want to work.
Can someone please help me, guide me and tell me what exactly I have to do to replace the out of the box bootstrap template.
I am trying to use this one Bootstrap template
Thank you!
Saturday, December 9, 2017 2:37 PM
Answers
-
User-474980206 posted
First make you layout file empty of any html
Create a controller action and razor file for each html file in the template
Copy the html file contents to the machine razor file
Last update the links in the razor file to correct action
Now your site should run. This should take about 10 minutes or less.
Next refactor common html to the layout. This most of the html in the razor files. I’d make the nav a view component
Make your changes.- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Saturday, December 9, 2017 6:56 PM -
User283571144 posted
Hi
I deleted the file, and it comes out like it should when there is no styling.
I added a screenshot of my problem in the solution folder.
What I did is very simple. Just deleted the bootstrap.css file, created a new one and pasted the code from this bootstrap.
According to your link and codes, I found you have used bootstrap 4.
But the asp.net core default template used bootstrap 3.3.7.
As far as I know, bootstrap 4 has many updates from 3.3.7.
The old css style which used in asp.net core default template is useless.
If you want to use bootstrap 4, You need replace all the css style to recreate your site.
More details about how to migrate from bootstrap 3.37 to 4, you could refer to this article.
I also suggest you could directly copy the bootstrap 4 html from the bootstrap example site and change the view.
Best Regards,
Brando
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, December 21, 2017 2:17 AM
All replies
-
User-474980206 posted
First make you layout file empty of any html
Create a controller action and razor file for each html file in the template
Copy the html file contents to the machine razor file
Last update the links in the razor file to correct action
Now your site should run. This should take about 10 minutes or less.
Next refactor common html to the layout. This most of the html in the razor files. I’d make the nav a view component
Make your changes.- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Saturday, December 9, 2017 6:56 PM -
User1073717099 posted
This is a way to do. I totally forgot! But I have also a problem with the getbootrstrap templates, which I earlier just replaced the code inside the bootrstrap.css file, but now it seems to not work!
Saturday, December 9, 2017 7:09 PM -
User283571144 posted
Hi arianit,
This is a way to do. I totally forgot! But I have also a problem with the getbootrstrap templates, which I earlier just replaced the code inside the bootrstrap.css file, but now it seems to not work!Could you please tell me which bootrstrap.css code you have replaced?
Have you set the right bootrstrap.css path in your razor page?
If possible, I suggest you could give me the example of the bootstrap.css file for us to reproduce the issue.
Best Regards,
Brando
Wednesday, December 13, 2017 8:00 AM -
User1073717099 posted
If possible, I suggest you could give me the example of the bootstrap.css file for us to reproduce the issue.this is the template I tried to use bootswatch/cosmo/
I replace the bootstrap.css file in my project, or better say the content. In MVC 5 it was just like that and it worked. Now with Asp.Net Core 2.0 it doesn't work! It is actually the same as it comes with the Asp.Net Core template, just with different color schema.
Kind Regards,
Arianit
Wednesday, December 13, 2017 10:11 AM -
User-474980206 posted
this is the template I tried to use bootswatch/cosmo/
this is not a page template as originally asked about, but a custom bootstrap css file which changes the look / color of the css components. in this case, you just reference a replacement css file.
Wednesday, December 13, 2017 3:05 PM -
User1073717099 posted
in this case, you just reference a replacement css file.As much as I know, replacing the bootstrap.css content will do the work. But it doesn't
Thursday, December 14, 2017 6:33 AM -
User283571144 posted
Hi arianit,
I suggest you could try to delete the whole bootstrap.css content to see if the page has changed.
If possible, please share a little project in github or OneDrive for us to reproduce your issue.
It will be more easily for us to find the reason and solution.
Best Regards,
Brando
Friday, December 15, 2017 6:26 AM -
User1073717099 posted
I suggest you could try to delete the whole bootstrap.css content to see if the page has changed.I deleted the file, and it comes out like it should when there is no styling.
I added a screenshot of my problem in the solution folder.
What I did is very simple. Just deleted the bootstrap.css file, created a new one and pasted the code from this bootstrap.
Kind Regards,
Arianit
Sunday, December 17, 2017 1:17 PM -
User283571144 posted
Hi
I deleted the file, and it comes out like it should when there is no styling.
I added a screenshot of my problem in the solution folder.
What I did is very simple. Just deleted the bootstrap.css file, created a new one and pasted the code from this bootstrap.
According to your link and codes, I found you have used bootstrap 4.
But the asp.net core default template used bootstrap 3.3.7.
As far as I know, bootstrap 4 has many updates from 3.3.7.
The old css style which used in asp.net core default template is useless.
If you want to use bootstrap 4, You need replace all the css style to recreate your site.
More details about how to migrate from bootstrap 3.37 to 4, you could refer to this article.
I also suggest you could directly copy the bootstrap 4 html from the bootstrap example site and change the view.
Best Regards,
Brando
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, December 21, 2017 2:17 AM -
User1073717099 posted
Thank you. I kinda tried to update to bootstrap 4, because I saw that the versions were different. But I also thought this is something, that the css file should take care. The Asp.Net Team changed a lot and it was hard to keep up, especially after taking a break and waiting for a stable version. Now everything is different.
This all bower thing is new for me, coming from Asp.Net MVC 5.
Thank you for your help.
Thursday, December 21, 2017 10:37 PM