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?
I had the same problem and I found what was in my case -When adding to web.config:<pages styleSheetTheme="Default" theme="Default"></pages>
<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.
<pages theme="Default"></pages>
iframe - , , CSS. , , , .
CSS ? , , CSS . CSS , .
, .css App_Themes/YourTheme .
<system.web> <pages theme="ThemeName"> <controls> </controls> </pages> <system.web>
, CSS.
, , CSS ( , ), , , .css , .
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.
Source: https://habr.com/ru/post/1703447/More articles:Π‘ΠΎΠ²ΠΌΠ΅ΡΡΠ½ΠΎΠ΅ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠ΅ ΡΠΈΠΏΠΎΠ² Π΄Π°Π½Π½ΡΡ ΠΈΠ· Π½Π΅ΡΠΊΠΎΠ»ΡΠΊΠΈΡ Π²Π΅Π±-ΡΡΡΠ»ΠΎΠΊ - c#How can I get a subset of a list based on a Datetime key in C #? - sortingHow can I manipulate RagDoll with farseer physics in Silverlight? - wpfΠΠ°ΠΊ ΠΎΠ±Π½ΠΎΠ²ΠΈΡΡ ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ VB6 Ρ XP Π΄ΠΎ Vista? - windows-vistaVista Phantom ΠΠ°ΡΠ°Π»ΠΎΠ³ - windows-vistaΠΠ°ΠΊ ΠΏΠ΅ΡΠ΅Π΄Π°ΡΡ ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΠ΅ ΠΎΠ± ΠΎΡΠΈΠ±ΠΊΠ΅, ΡΠ³Π΅Π½Π΅ΡΠΈΡΠΎΠ²Π°Π½Π½ΠΎΠ΅ ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ΠΌ xslt Π΄Π»Ρ java-ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΡ - javaElevated privileges for VB6 - windows-vistaPer-filetype "View whitespace" option in Visual Studio - visual-studioInheriting aliases within UNIX / usr / bin / script - scopeE # myid vs. #myid CSS Selectors - cssAll Articles