Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET Ajax IE9
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 11-Oct-12 11:34am
Comments
Marcus Kramer at 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 at 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

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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,
ScriptManager.RegisterStartupScript(this, GetType(), "ShowMPE", "showMPE();", true);
In aspx page, add the following script,
<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.
<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>
  Permalink  
v2

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



Advertise | Privacy | Mobile
Web02 | 2.8.1411022.1 | Last Updated 9 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100