.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
For asp.net core 2.1,it uses bootstrap v3.And for asp.net core 2.2,it uses bootstrap v4.
I think the fastest way is to create a project with asp.net core 2.2.Then copy the whole Index.cshtml and _Layout.cshtml.And for 2.2,it does not contain the _CookieConsentPartial in Layout,you could add by yourself.
Best Regards,
Rena
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
57 Points
169 Posts
How to get Core 2.1 Cookies Consent Message to Display
Apr 24, 2020 12:07 AM|coreysan|LINK
I started learning Core 2.1, and made use of the partial view for Cookies Consent. Things went well.
Then I changed the bootstrap file from v. 3 to v.4, and the consent message looks wonky. The navbar
collapses by default, the button is now a tiny 4 pixel barline, and the entire navbar is unformatted.
Has anyone come across this and fixed it? What did you do?
I'd be grateful for any advice on how to fix this. All my code is auto-generated. Only bootstrap changed.
Contributor
2690 Points
874 Posts
Re: How to get Core 2.1 Cookies Consent Message to Display
Apr 24, 2020 08:42 AM|Rena Ni|LINK
Hi coreysan,
You could create a project and see the difference between bootstrap v4 and v3,change like below:
Best Regards,
Rena
Member
57 Points
169 Posts
Re: How to get Core 2.1 Cookies Consent Message to Display
Apr 24, 2020 10:45 PM|coreysan|LINK
Hi Rena! Thanks for working with me on this.
I copied your code exactly, and ran with borrstrap 3.0.3, and also for 4.3.1.
Both look awful.
Version 3 shows the consent dialog and buttons at the top, but then corrupts the nav bar by inserting a little gray bar about 4-5 pixels high.
Version 4 is worse. It doesn't show any dialog because the default project slideshow covers it up. It also shows the tiny gray bar.
Maybe if I just redesign the whole thing? What would you do?
Contributor
2690 Points
874 Posts
Re: How to get Core 2.1 Cookies Consent Message to Display
Apr 27, 2020 09:40 AM|Rena Ni|LINK
Hi coreysan,
For asp.net core 2.1,it uses bootstrap v3.And for asp.net core 2.2,it uses bootstrap v4.
I think the fastest way is to create a project with asp.net core 2.2.Then copy the whole Index.cshtml and _Layout.cshtml.And for 2.2,it does not contain the _CookieConsentPartial in Layout,you could add by yourself.
Best Regards,
Rena
Member
57 Points
169 Posts
Re: How to get Core 2.1 Cookies Consent Message to Display
Apr 27, 2020 04:01 PM|coreysan|LINK
Rena,
Thanks so much for your help! This discussion motivated me to look for alternate code, and I found the right layout in MSDN.
It's just a reduced partial view and works much, much better!
Thanks for pushing me!
Corey