AspAlliance.com LogoASPAlliance: Articles, reviews, and samples for .NET Developers
URL:
http://aspalliance.com/articleViewer.aspx?aId=1232&pId=-1
CodeSnip: Taming the Page Flash Beast in ASP.NET 2.0
page
by Shaun Eutsey
Feedback
Average Rating: 
Views (Total / Last 10 Days): 24635/ 51

Introduction

Technology advancements are great.  They really are.  They create ways of doing things faster, better and with added stability.  However, every once in a while something gets left behind from an older technology, whether it was because it was not widely used or there were bugs in its implementation or there is a new feature that deprecates the old one.

Problem

To me, one of the features that I miss the most about ASP.NET 1.1 is the SmartNavigation.  Yes, it had some bugs, but the idea behind it was brilliant.  With one simple setting you could maintain the pages postback position and virtually eliminate the page flash. 

While there is a very real and valid alternative in .NET 2.0 for handling postback position, MaintainScrollPositionOnPostback, there is still the issue with page flashes.  I find pages flashing annoying and I have recently been on a quest to defeat this enemy. 

While searching high and low for a good, solid, solution to my dilemma, I remembered a meta-tag that I have not used in many years.  A meta-tag that would take care of all page flash problems, while letting MaintainScrollPositionOnPostback handle the scroll position.

Solution

“What is this amazing tag?” you say.  “How can I slay the page flashing beast?” you ask.  Just add the following meta-tag to the <head> of your page or in your master page.

Listing 1

<meta http-equiv="Page-Exit" Content="blendTrans(Duration=0.01)"/>

Most likely the reason that I forgot this tag is that it is usually used to create a highly painful user experience, by blending one page to the other.  However, when the duration is moved down to 0.01, like I have it here, the transition from postback to refresh is so fast that the human eye does not see it and all realization of a page flash is utterly removed.

Conclusion

I hope this helps any of you who have been beleaguered by page flashing in 2.0.  I know it has brought me a great amount of relief in trying to provide a consistent and solid experience for my users.


Product Spotlight
Product Spotlight 

©Copyright 1998-2021 ASPAlliance.com  |  Page Processed at 2021-11-29 10:00:21 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search