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();        

    function CloseCallback(result, target) {

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.



"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,


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.

  • 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

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.