Search code examples
asp.netresponse.redirect

Screen Flicker On Response.redirect


I have an issue where the screen goes white for a millisecond on a redirect when rendering the new page.

This causes the screen to flicker and annoys me so.

I have had a little scoot round the web and have found this IE solution which works on IE however it does not on chrome or FireFox.

<meta http-equiv="Page-Enter" content="blendTrans(Duration=0.0)" />
<meta http-equiv="Page-Exit" content="blendTrans(Duration=0.0)" />

Plus I'm sure using this method will have some knock on effects on update panels and Ajax controls.

Is there a way of setting the server to render the full page before giving it the client so not to have this white millisecond that works for all browsers.

Any ideas will be welcomed.


Solution

  • Is there a way of setting the server to render the full page before giving it the client

    short answer: no. that's how a web browser works.

    even with the fastest possible servers (using statically cached pages as you describe them), you're only decreasing the average "white" time, not eliminating it all together. as you're seeing with IE, that default page transition is part of the browser code, not something the server-side gets control over. if you write your own browser, you can write it to wash black, wash white, or hold the transition until the entire page is loaded, like IE does.

    as other people mention, getting your page size down will decrease the "white" time. this time is not only the time the server takes to generate the page, but also all the network travel time for the page, images, javascripts, css, etc. that's why you can never fully get rid of it - only hide it using browser tricks.

    and i'm not talking about "client-side" anything. that won't work. the "client-side" code isn't even downloaded, much less running, when the browser decides to white-wash the canvas. it's kind of a standard part of "the internet" that everyone just gets used to; it wasn't designed to be a slide show viewer or a graphically perfect renderer. unfortunately, if you care about transitions that much, HTML is probably not the right medium for your work.