Sharepoint 2010 Scrollbar not working problem when hiding ribbon


When using SPSecurityTrimmedControl for hiding Sharepoint 2010 ribbon scrollbar is not working for users who denied to see ribbon.

If you use SPSecurityTrimmedControl cover all divs that include the ribbon in masterpage , the page is not renders correctly. This is an incorrect programming situation .

Incorret usage:

<SharePoint:SPSecurityTrimmedControl ID="IncorrectUsage" runat="server" PermissionsString="ManageWeb">
<div id="s4-ribbonrow" style="display:none">
<div id="s4-ribboncont">
    Your ribbon

Use your SPSecurityTrimmedControl inside of divs which is already covers ribbon.


<div id="s4-ribbonrow" style="display:none">
<div id="s4-ribboncont">
<SharePoint:SPSecurityTrimmedControl ID="CorrectUsage" runat="server" PermissionsString="ManageWeb">
    Your ribbon
</SharePoint:SPSecurityTrimmedControl></div> </div>


For hiding ribbon correctly you need to add extra scripting .

First to be sure jquery added your master page .

<script type="text/javascript" src=""></script>

And we add an extra SPSecurityTrimmedControl which contains javascript for showing ribbon to who have to see.

<SharePoint:SPSecurityTrimmedControl ID="st1" runat="server" PermissionsString="ManageWeb">
this text will be shown by only admins
<script type="text/javascript">

and adding an extra attribute to cover div for hiding ribbon

<div id="s4-ribbonrow" style="display: none;">

Dont forget to save your master page and publish it.

If you dont want to attend too much you can download and use this tool for this.

Happy solutions …
Bye now.


About bpostaci
Escalation Engineer in Microsoft.

4 Responses to Sharepoint 2010 Scrollbar not working problem when hiding ribbon

  1. fungisil says:

    Great, what a nice read! This discussion board is precisely what I used to be on the lookout for, pleased I discovered this! Will certainly be linking this on my weblog! funginix

  2. JimiSweden says:

    Thanks a lot!

    // JimiSweden

  3. Tin says:

    Hello Bugra

    It totally works! Thanks. I have a little issue though. Not sure if it’s just me. I have a tool bar in my page. After I click ‘Cancel’ from attaching file, I’m seeing the blue bar again. That’s why I did the incorrect way. But if I did the incorrect way, my scroll bar is not working =/

  4. Thanks a lot sir !!! It worked for me !!!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: