IE9中不显示Ajax Modal弹出窗口 [英] Ajax Modal popup doesn't show in IE9

查看:128
本文介绍了IE9中不显示Ajax Modal弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以帮忙,我们已经在此问题上花费了2周的时间.
我的环境是带有最新Ajax工具包(3.5)的Visual Studio 2008.

我在asp.net页面上有一个模式弹出控件.模态弹出窗口内部有一个更新面板.从后面的代码开始,更新面板得到更新(将其更新模式设置为有条件的),随后代码调用模式弹出窗口显示方法.

在IE9中,出现模式弹出窗口,但不会停留在屏幕上.在Win7专业版(32位)上,它是非常随机的,但是在Win7企业版和家庭版上,模式弹出窗口始终没有出现在屏幕上.

我已经尝试从javascript,控件上的z-index等中获取模式弹出式处理程序.
请注意,这仅是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.

推荐答案

朋友,我终于想出了一个解决方案,想更新此线程(以防万一,它对某人有用).

为了解决问题,我有一个无法在IE9浏览器上正常运行的Ajaxpopup,我尝试升级可以在网上获得的ajax控件,所有修复程序和属性,但没有任何帮助.我们的一位合同开发人员找到了使用jquery的解决方案,并且效果很好.下面添加了相同的内容.

在in按钮Click事件(显示弹出窗口的按钮)后面的代码中,添加了以下内容,
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);

在aspx页面中,添加以下脚本,

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


(窗口).bind(" 功能(){ showMPEWorker(); }); } 函数 showMPEWorker() { 尝试 { var mpe =
(window).bind("load", function() { showMPEWorker(); }); } function showMPEWorker() { try { var mpe =


find(' 如果(mpe == ) { // showMPE(); 返回; } 其他 mpe.show(); } 捕获(错误) { 警报(err.message); } } /script>
find('<%=EndorsmentDetailsPopup.ClientID %>'); if(mpe==null) { //showMPE(); return; } else mpe.show(); } catch(err) { alert(err.message); } } /script>


如果上述方法仍然无效(在某些情况下可能会发生),请按如下所示使用循环调用它并重试10秒钟.


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 =


这篇关于IE9中不显示Ajax Modal弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆