Last post May 22, 2014 03:22 AM by CASPartan
May 22, 2014 12:26 AM|CASPartan|LINK
I'm doing some reading... So if you have a _Layout.cshtml page, what's the advantage (if any) of using
as opposed to just
<link rel="stylesheet" media="screen,print" href="~/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="~/css/jquery-ui-1.8.16.css">
<link rel="stylesheet" type="text/css" href="~/css/mysite.css">
<link rel="stylesheet" type="text/css" href="~/css/mysite-media.css">
Is @Styles.Render for MVC only, or will it work on a Webpages Razor project?
How do you control which CSS gets loaded first? Sometimes the ordering of CSS is important.
May 22, 2014 02:36 AM|Mikesdotnetting|LINK
Styles.Render() is available to Web Pages. It minifies the style sheets, thereby reducing their size and inproving download speeds (so long as your debug attribute in the compilation element in the web.config file is set to 'false'). You can read more about
it here: http://www.mikesdotnetting.com/Article/197/Optimising-ASP.NET-Web-Pages-Sites-Bundling-And-Minification
You can determine the order of css files through the order in which they are declared in the HTML, or added to a bundle if you are using the optimisation package.
May 22, 2014 03:22 AM|CASPartan|LINK
As always Mike, thanks for the answer... and your website! Lol, you're a mind reader - everything seems to be there already.