SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm branding the sharepoint ribbon and need some changes (css) when the page gets in pagepreview mode.

I've got this code

<SharePoint:SpSecutirtyTrimmedControl runat="server" ID="SPSecurityTrimmedControlRibbon" PermissionString="BrowseDirectories" PermissionMode="Any">
    <Common:ScriptCssLink DebugLink="/Style%20Library/css/editor.css" Link="/Style%20Library/css/editor.css" runat="server"/>

Why does this css loads when the site is in PagePreview mode - ex http//

share|improve this question

The security trimmed control only "trims" based on permissions. The page preview mode runs with the same user and therefore the same permissions so it will make no difference.

I solved such an issue by creating a custom control that rendered only if the query string contained PagePreview. You might try something like that.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.