CSS file referenced twice

I have an asp.net web application that uses themes, iframes and master pages. I analyzed the pages with the web developer IE and FF Firebug and noticed that each page links to the same css file twice. I don’t know because of the model of the main page or because of the iframe. Does anyone know how to reference css only once?

+3
source share
5 answers

I had the same problem and I found what was in my case -
When adding to web.config:
<pages styleSheetTheme="Default" theme="Default"></pages>

The .css file will be transferred to the source code twice since it is just adding:
<pages theme="Default"></pages>
and then it will only be displayed once.

+4
source

iframe - , , CSS. , , , .

+2

CSS ? , , CSS . CSS , .

+1

, .css App_Themes/YourTheme .

<system.web>
    <pages theme="ThemeName">
        <controls>
        </controls>
    </pages>
<system.web>

, CSS.

, , CSS ( , ), , , .css , .

+1

I assume the answer for you is to stop using IFRAME. You can embed main pages if you need to use reusable pieces of content. One of the reasons people use IFRAME is when they serve content from a remote site, but since you said that it calls the same CSS file, it isn’t.

More information on what IFRAME does will be helpful.

0
source

Source: https://habr.com/ru/post/1703447/


All Articles