Design and CSS styles
Version 7.x > Design and CSS styles > DesignMode.css is always included on my root page View modes: 
User avatar
Member
Member
Conrad - 4/4/2013 4:13:33 PM
   
DesignMode.css is always included on my root page
I have a intranet site that only has two pages to navigate to so far. The root directory is my front page with a custom document library. The second is a custom profile page. The profile page behaves as expected. It only loads the css files I linked in the master page and only loads DesignMode.css when the same page is open in cmsdesk. My root page always loads DesignMode.css regardless if it is in design mode or not. All my pages are set to inherit the default css sheet, which in the site manager settings is set to none.

Any insight into this problem would be very much appreciated.

User avatar
Member
Member
Conrad - 4/4/2013 4:29:11 PM
   
RE:DesignMode.css is always included on my root page
I forgot to mention that after each postback another DesignMode.css file is downloaded. This is very undesirable because a user could click the document library dozens of times.

User avatar
Kentico Consulting
Kentico Consulting
richards@kentico.com - 4/5/2013 11:19:04 PM
   
RE:DesignMode.css is always included on my root page
Hi Conrad,

Im not really sure how this could be happening. The DesignMode.css file should be loaded only for pages other then livepage. The code for this is by design and stands as:

// Register the Design mode CSS for other than live site modes
if (CMSContext.ViewMode != ViewModeEnum.LiveSite)


I have tested this and on the front page of my site there are no registered DesignMode.css. This happens only when Im logged into cms. Could you try logging out of your profile and see your site as a unregistered user to see if the file is still being loaded? (Just for testing purposes).

Kind regards,
Richard Sustek

User avatar
Member
Member
Conrad - 4/8/2013 5:03:29 PM
   
RE:DesignMode.css is always included on my root page
Hey Richard,

Thank you for your consideration. I've fixed this issue by digging into the problem a little deeper and using the information you provided. I slowly removed my controls to find which one might think its not "IsLiveSite". I found which web part was causing the issue. That web part only contained one control, which lead me to this piece of code.

if (CMSContext.ViewMode == ViewModeEnum.LiveSite)
{
CSSHelper.RegisterDesignMode(Page);
}


I'm really not sure why I included this(probably trying to mirror another control) but once removed, it solved the problem.

Thank you for your help.

User avatar
Kentico Consulting
Kentico Consulting
richards@kentico.com - 4/9/2013 10:41:17 PM
   
RE:DesignMode.css is always included on my root page
Hi,

You are welcome, Im glad to you were able to find the issue.

Also thank you for letting us and others know the solution, it is much appreciated.

Kind regards,
Richard Sustek

User avatar
Member
Member
kevincarter185-yahoo - 11/9/2013 12:13:35 AM
   
RE:DesignMode.css is always included on my root page
Better idea. Thanks for this great post it gives such a great help. Visit here