Sign up ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

1 Answer 1

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.