All HTML Page Types
Your page content should now load before functionality giving you a boost in speed and give the user a more responsive looking website.
<!– HTML Content here –>
Then, you simply modify your _Layout.cshtml page like so.
<!– Header content –>
@RenderSection(“scripts”, required: false)
If you’re implementing this on an existing site, you might have to do some thorough testing to make sure none of your scripts are running before the declarations. For simpler sites, or ones that have been well coded without heavy reliance on external libraries (jQuery, bootstrap, etc …) you should have no problem applying this paradigm to your pages.