How to specify the cascading style sheet for one html page in ASP.NET Core MVC
Content
<p>Say you are creating a website that has different pages (in my case a blog), And on one of those pages you need to include a specific style sheet that the rest of the pages do not use. You are in luck, because it can be done easily with sections. </p>
<p>In the view that needs a different CSS, create a section and put the CSS in it like so:</p>
<p><code>@section cssSection { <link rel="stylesheet" href="~/css/myStyle.css"> }</code></p>
<p>In the shared layout view (_Layout.cshtml), render the section inside of the header:</p>
<p><code> @RenderSection("cssSection", false)</code></p>
<p>The first parameter is the section name we defined in our view. The second parameter says whether or not rendering the section is required.</p>
<p>And that's all there is to it! The css should now be included with your html page.</p>