Controlar la colocación del orden de enlace CSS del tema ASP.NET

I have a mix of css in themes and universally (non theme specific) files. I would like the theme css files to be included first before my custom css files - how can this be done (see below, the StyleSheet.css file is a theme file which is always included last, I want it included first)

<!-- CSS needed on every page -->

<link rel="Stylesheet" type="text/css" href="App_themes/PageLayout.css" />
<link rel="Stylesheet" type="text/css" href="App_themes/EmbedFonts.css" />

<!-- CSS placed by ASP.NET -->

<link href="App_Themes/DarkTheme/StyleSheet.css" type="text/css" rel="stylesheet" /><title>

Note: I am using master pages with themed Web forms.

preguntado el 30 de enero de 12 a las 19:01

How are they being added now? Are you using master pages? -

1 Respuestas

EDIT: Since you're only using themes to pull CSS, use Page property StyleSheetTheme instead of Theme. That should render your theme CSS links first instead of last, making them overridable. This was confirmed in la respuesta de esta pregunta.
Este artículo de MSDN explains the difference between the two properties, alluding to how the stylesheet links would be rendered.

Espero que esto ayude.

contestado el 23 de mayo de 17 a las 12:05

Indeed this would solve the problem, however I rather like using themes with their own individual css files. - James

Are you using the Theme property or the StyleSheetTheme property? - joelmdev

I am using themes, set at the top of each Web Form. - James

Are you using other elements of's theming (eg templating, etc) or are you only using the Theme property to set the stylesheet? - joelmdev

I am only using the Theme property to set the stylesheet(s) - James

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.