Click here to Skip to main content
15,892,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, can someone please help, we have already spent 2 weeks of time on this issue.
My environment is visual studio 2008 with the latest Ajax toolkit (3.5).

I have a modal popup control on a asp.net page. The modal popup has a update panel inside. From code behind, the update panel gets updated (for which the update mode is set to conditional) and subsequently code calls the modal popup show method.

In IE9, the modal popup, comes up but doesn't stay on the screen. It is very random on win7 professional edition (32bit) but the modal popup consistently doesn's stay on the screen on win7 enterprise and home edition.

I have tried modal popup handlers from javascript, z-index on controls etc.
Kindly note that this is an issue only in IE9, please let me know if you have any suggestions.
Posted
Comments
fjdiewornncalwe 11-Oct-12 16:49pm    
If it works on some IE9 instances and not others, then it is likely that the IE9 settings are the issue, not your popup itself. Do all the machines in question have the same settings for IE9 regarding pop up blockers and such?
Member 2907700 11-Oct-12 16:55pm    
Thanks Marcus, yes I checked the IE9 settings. The popup comes up but doesn't stay on Windows 7 enterprise editon and home edition. It looks like when the updatepanel gets refreshed, the modalpopup is losing some stylesheet or its state. Reason I say this is, when I don't modify the controls inside of the update panel and not call the Update method from code behind, the popup comes up everytime with the previous state of update panel.

1 solution

Friends, I finally figured out a solution and wanted to update this thread (just in case if it is useful for someone).

To reitreate, I have a Ajaxpopup that doesn't work consisitently on IE9 browser, I tried upgrading the ajax controls, all fixes, properties that I can get on the net but nothing helped. One of our contract developer figured a solution using jquery and it perfectly worked. The same is added below.

In the code behind in button Click event (the button that shows the popup) addd the following,
C#
ScriptManager.RegisterStartupScript(this, GetType(), "ShowMPE", "showMPE();", true);
In aspx page, add the following script,
JavaScript
<script type="text/javascript" language="javascript">
 
function showMPE()
{
      //Did this because just calling showMPEWorker fails because it gets executed before
      //the page is loaded
    $(window).bind("load", function() {
        showMPEWorker();
    });
}
 
function showMPEWorker() 
{
    try
    {
        var mpe = $find('<%=EndorsmentDetailsPopup.ClientID %>');
        if(mpe==null)
            {
            //showMPE();
            return;
            }
        else
            mpe.show();
    }
    catch(err)
    {
        alert(err.message);
    }
}
/script>

If the above still doesn't work (it may in some cases), use a loop to call it with retry for 10 seconds as follows.
JavaScript
<script type="text/javascript">
    var retryCount=0;

    function showMPK()
    {
          //Did this because just calling showMPKWorker fails because it gets executed before
          //the page is loaded.  Try 10 times before giving up.
          if(retryCount<=10)
          {
          setTimeout(function(){showMPKWorker()},1000);
          retryCount++;
          }
          else
          {
          alert("Unable to display popup dialog.");
          }
    }

    function showMPKWorker()
    {
        try
        {
            var mpk = $find("<%=KeyDataPopup.BehaviorID %>");

            if(mpk==null)
                {
                showMPK();
                return;
                }
            else
                mpk.show();
        }
        catch(err)
        {
            alert(err.message);
        }
    }

</script>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900