Home Change language: Register | Log in
Beta cloud
Improve your life online
Click to learn more
Click to learn more
Click to learn more

SharePoint 2010 modal dialogs scrolling

Sometimes there is a bug in SharePoint 2010 modal dialog scrollbars. Sometimes they are inactive and user cannot scroll the dialog. If user wants to access other dialog places, he must to maximize (if possible) dialog - then scrollbars activates.

I have a small hack (work arround) of this problem. In any webpart of dialog in CreateChildControls function you have to execute this code:

            string csName = "ResizeScript";
            if (!Page.ClientScript.IsStartupScriptRegistered(csName))
                string script = @"
                window.setTimeout('DoScrolling(\'yes\');', 1000);
                function DoScrolling(val) {
                    document.getElementsByTagName('body')[0].setAttribute('scroll', val);
                    if (val == 'yes') {
                        window.setTimeout('DoScrolling(\'no\');', 10);
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), csName, script, true);

and the problem will go off.

Tags: Programming, SharePoint, Javascript
Created on: 2013-11-15 14:46:30
Updated on: 2013-11-15 14:46:30