简体   繁体   English

Asp.net ModalPopupExtender在回发期间闪烁

[英]Asp.net ModalPopupExtender flickering during PostBack

I'm working on a web application that requires me to use a modalpopup I recently made within a user control. 我正在开发一个Web应用程序,它要求我使用我最近在用户控件中创建的modalpopup。 Everything works as expected, but somehow after a PostBack, and not always, the panel used in the modal flickers (blink) on the screen very briefly. 一切都按预期工作,但是以某种方式在回发之后(并非总是如此)在屏幕上模态闪烁(闪烁)中使用的面板非常短暂。 I have read on dozens of forums saying that I needed to add "display:none;" 我在几十个论坛上都读过,说我需要添加“ display:none;”。 to the style tag of this panel. 此面板的样式标签。 This usually "helps", and most of the postbacks don't show the panel, but some do. 这通常是“有帮助的”,大多数回发不显示面板,但有一些会显示。 Seems that the property is being ignored somehow, but I can't find where, how, when. 似乎该属性以某种方式被忽略,但我找不到位置,方式和时间。

I have also tried debuging the javascript with firebug, tested all page events and even tried taking a look at the ajax modalpopupextender sourcecode, but couldn't fix this issue. 我还尝试使用Firebug调试javascript,测试了所有页面事件,甚至尝试查看ajax modalpopupextender源代码,但无法解决此问题。 The browser I HAVE to make this web application work is Mozilla Firefox 3.5.10, that is the current version on the company I work for. 浏览器我不得不做出这个Web应用程序的工作是Mozilla Firefox 3.5.10,这是对我公司工作的最新版本。 This can't be changed due to corporate policies. 由于公司政策,无法更改此设置。

Due to quality and user experience issues that arise with this flickering, I leave it as is, so if anyone can help me out I'd appreciate that. 由于这种闪烁会导致质量和用户体验问题,因此我将其保持不变,因此,如果有人可以帮助我,我将不胜感激。 I'm also on a rather tight schedule, so any quick help will be appreciated too, as I'm ready to try and test changes on the go. 我的时间表也很紧迫,因此任何快速帮助也将不胜感激,因为我准备随时随地测试变更。

Please let me know of any doubts or questions. 请让我知道任何疑问或疑问。

Thanks in advance. 提前致谢。

The following works for me: 以下对我有用:

<script type="text/javascript">
    window.onbeforeunload = function () {
        document.getElementById("PanelDialog").style.display = "none";

    }
</script>

If your CSS is in an external file, it's possible that the HTML is being loaded and rendered before the CSS is downloaded, causing the flicker. 如果您的CSS位于外部文件中,则有可能在下载CSS之前先加载并呈现HTML,从而导致闪烁。 If this is the case, then adding style="display:none" directly to the HTML tag ought to fix it. 如果是这种情况, style="display:none"直接在HTML标记中添加style="display:none"来进行修复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM