Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

i am trying to open a visualwebpart (WITH UPDATE PANEL) inside modal dialog. I also want "Loading content please wait" notification box while loading the webpart. my modal box declaration is like the following.

function openDialog(URL, theTitle) {
        var options = SP.UI.$create_DialogOptions();
        options.url = URL;
        options.title = theTitle;
        options.allowMaximize = false;   
        options.autoSize = true;      
        options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallback);
        var windowheigth = getHeight();        
        SP.UI.ModalDialog.showModalDialog(options);
        SetPosition();
    }

    function CloseCallback(result, target) {
        location.reload(true);
    }

When I define options.height and options.width the loading content notification not showing..but if I remove height and width i get weird width of modal dialog with vertical and horizontal scroll bars...what should I do and how to resolve it..example code with proper direction where to add would highly be appreciated.

thanks

share|improve this question
add comment

1 Answer

"Loading content please wait" notification box while loading the webpart

Since its a Visual webpart with .ascx file then you can add your code for example displaying a label saying "Loading content...." for Page_Load method for webpart class let say "VisualWebpart1.cs" in "link to example" given below,

http://msdn.microsoft.com/en-us/library/ff597539(v=office.14).aspx

and then in code behind file of User Control in Page_Load method you can get reference to label control and change its visibility, that's the first thing came in my mind but there might be some other better way of doing it, however it might look a bit stupid and end user might think system is slow.

In your code you said you're providing custom height and width but when you add them do you remove "options.autoSize = true;" as you are setting up height and width yourself and then also adding autoSize property.

Page Life Cycle of ASP.NET

Hope it helps.

share|improve this answer
    
well ive got a neat solution from somewhere..just added following in my CSS file..thats it..thanks iframe { background-image: url("/Style%20Library/Images/animatedspinner_2.gif"); background-repeat: no-repeat; background-position: 50% 50%; } –  user342944 Dec 23 '12 at 15:57
add comment

Your Answer

 
discard

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.