Reputation: 2844
I have an ASP website that is using App_Themes
in the project.
Inside this website, I have merged another colleague's work who has been working on /colleague_work/
. The new work has new styles independent of the App_Themes, namely /colleague_work/styles.css
.
When I view the source of the site at /colleague_work/default.aspx
, the App_Theme/Theme1/AppStyles.css
is being injected to the page and is overwriting styles.
How do I swap the stylesheets, or disable the first stylesheet, without upsetting the rest of the website's styling from App_Themes? The colleague's stylesheets are not allowed to be moved from their location into the App_Themes folder.
File tree structure:
Upvotes: 0
Views: 573
Reputation: 2844
Within ASP.NET
, attributes and elements take precedence in the following order (first to last):
@ Page
directive<pages theme="themeName">
elements in the <system.web>
section of a web.config
fileStyleSheetTheme
attributes in the @ Page
directive<pages styleSheetTheme="themeName">
elements in a web.config
fileOne workaround would be to disable the themes for a specific page, by setting the EnableTheming
attribute of the @ Page
directive to false, while also referencing the styles.css
with a <link>
tag.
This is done before the <!DOCUTYPE>
tag, and for the /colleague_work/default.aspx
page, would look something like this:
<%@ Page Language="C#" EnableTheming="false" %>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
...
</html>
More information:
Upvotes: 1