“Fake Ajax”… For Real ASP.NET Developers

Every ASP.NET developer knows by now that in ASP.NET 2.0 (and above), the “Smart Navigation” feature has been removed and replaced by the additional necessity for the use of the AJAX toolset or its variants. I wonder why such a simple feature was replaced by a more complex one…
The “SecretGeek”, who keeps a small technical blog, offers up a very useful tip for ASP.NET developers who want to easily avoid screen flicker without resorting to the extra work that AJAX imposes.
“Fajax — the fake alternative to ajax” is a simple “meta” technique that easily removes this annoying feature when using ASP.NET server-controls that require a post-back to the server. By inserting the two tags shown in his tip below, into the “<head>” area of an Aspx page, developers can now gain control over this annoyance quickly and simply. By adjusting the duration time in either of the tags, control can be had over the time delay.
One developer has reported that by reducing the duration to “0.1″, the response of the screen-repaint is so fast that it appears as if the original “Smart Navigation” property had been used instead.
This technique will not affect Firefox, though it appears to have eliminated what screen flicker there was on pages without this addition. However, the blending effect is designed for Internet Explorer.
Please take a quick look at the “SecretGeek’s” site for some very interesting viewpoints on our profession…
http://secretgeek.net/index.asp#top

http://secretgeek.net/fajax.asp
Fajax — the fake alternative to ajax
Put these two tags in the head of your html document:
<META http-equiv=”Page-Enter” content=”blendTrans(Duration=0.2)”>
<META http-equiv=”Page-Exit” content=”blendTrans(Duration=0.2)”>
That’s it. You’ve implemented Fajax: the fake alternative to ajax.
The blink that occurs on postback is no longer visible, most of the time.
Okay, it’s a dirty nasty trick. Don’t flame me, troll me, spam me or DoS me. I feel terrible as i write these words: blendtrans is a Microsoft function. In non-ie browsers it will have no effect.
How does it work?
When a page posts back (for example when you click a button on a form), it normally causes a screen flicker as the page is redrawn. In a lot of cases the screen that is redrawn is very similar to the previous screen, and the flicker is an annoyance, disrupting the user’s experience. The Blendtrans function causes the old page to blend smoothly into the new one, rather than flickering.
A lot of the time, this gives an identical effect to an ajax style http request. The page appears to have stood absolutely still as just one part of it is updated.
This simple trick alone gives you about 50% of the benefit of ajax, with a 1% of the effort. Having said that, it’s absolutely limited to that one visual benefit, and limited to one browser.
To get the full benefits of ajax, you will of course need to use ajax, not fajax. ![]()
Note that these effects are best not overused.
About this entry
You’re currently reading ““Fake Ajax”… For Real ASP.NET Developers,” an entry on TECH NOTES
- Published:
- May 4, 2008 / 3:05 pm
- Category:
- Tools & Code
- Tags: