Prevent ASP.NET themes from automatically adding CSS files

To deal with URL rewriting, I decided to programmatically add CSS links, rather than relying on the automatic behavior of ASP.NET to automatically add all CSS files in the theme to <head>ASPX pages.

I have successfully completed adding a CSS file with

<link type="text/css" rel="stylesheet" runat="server" id="CssFile" />

and set the actual url in the code.

My question is:

Is there a way to prevent the ASP.NET engine from automatically adding all CSS files to <head>my ASPX / homepage?

(Of course, I can still use my own folders and completely abandon the concept of App_Themes)

+3
source share
4 answers

, , , , , css, , , .

+4

, :

<%@ Page ... EnableTheming="false" Theme="" StylesheetTheme="" %>
+6
<head runat="server" visible="false" />
0
source

<%@ Master Language="C#" AutoEventWireup="true" Inherits="Front" Codebehind="Front.master.cs" **EnableTheming="false"** %>
was my solution to solve the problem.

-1
source

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


All Articles