Easy way to remove the default.css from DotNetNuke (DNN) 7

By | January 20, 2017 | 0 Comment
Category: DNN-DotNetNuke Tags:

I am currently working creating a simple DNN responsive skin using Bootstrap and found that default.css, skin.css is causing a trouble. I tried to find the solution of how to remove those css from being downloaded in the page and could not find the quick solution without using custom module and adding the tag into the skin object to remove it.

Here is an extremly quick way to fix it.

  • Open Default.aspx.cs file in a text editor
  • Go line 741 which shows the following lines of code
  • Comment out the code using /* */
ClientResourceManager.RegisterDefaultStylesheet(this, Globals.HostPath + "default.css");
ClientResourceManager.RegisterIEStylesheet(this, Globals.HostPath + "ie.css");

ClientResourceManager.RegisterStyleSheet(this, ctlSkin.SkinPath + "skin.css", FileOrder.Css.SkinCss);
ClientResourceManager.RegisterStyleSheet(this, ctlSkin.SkinSrc.Replace(".ascx", ".css"), FileOrder.Css.SpecificSkinCss);

Is it a best practice to change core? NO.
Does it work? Yes.
Is it quick? Yes.

About Vishal Monpara

Vishal Monpara is a full stack Solution Developer/Architect with 13 years of experience primarily using Microsoft stack. He is currently working in Retail industry and moving 1's and 0's from geographically dispersed hard disks to geographically dispersed user leveraging geographically dispersed team members.

Leave a Reply

Your email address will not be published. Required fields are marked *