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//test.com?pagepreview=true


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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