Alexandre Fernandes
Alexandre Fernandes

Reputation: 205

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. 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;" 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. 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. 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.

Upvotes: 4

Views: 2834

Answers (2)

Peter Darby
Peter Darby

Reputation: 11

The following works for me:

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

    }
</script>

Upvotes: 1

Blazemonger
Blazemonger

Reputation: 92953

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. If this is the case, then adding style="display:none" directly to the HTML tag ought to fix it.

Upvotes: 1

Related Questions