Recent Articles

GZip Vs. Deflate - Compression And Performance
After I wrote about a HTTP compression module in ASP.NET 2.0 one of my colleagues pointed out that the Deflate compression is faster than GZip.Because the HTTP compression module chooses GZip over...

App_Code: Why It's Better
I remember when ASP.NET 2.0 beta 1 was released about 2 years ago and I eagerly tried it out. The first thing that struck me as strange was the new application folders like App_Code, App_Data, and App_Themes etc.

Refactoring Your ASP.NET Project
One day at work i was refactoring my code as I do everyday, when it suddenly hit me that our ASP.NET projects were also refactored in a sense. For those of you who don't know what refactoring is, here's...

ASP.NET: Permanent Redirection
The easiest way to make a redirection in ASP.NET is using Response.Redirect(url). What it actually does is, that it creates a response with the "302 (Object...

Validating a URL with Regular Expressions
I had to build web form that took user input from standard ASP.NET input controls. In one of the text boxes the user must enter a valid URL, so I had to make some validation logic.

Visual Studio 2005 - Publishing Web Site
What's the purpose of site precompilation? As it turns out, improved performance is often brought as an evidence of the benefits of precompilation. While precompilation certainly saves users from the...

Microsoft Bridging VB6 And .NET Forms
A new toolkit from Microsoft will allow VisualBasic 6 developers to craft .Net WinForms that can be displayed in a VB6 application. The Interop Forms Toolkit reported on eWeek.com should help VB6 developers...

12.22.06


ASP.NET: Maintain Scroll Position After Postbacks

By Mads Kristensen

To maintain the scroll position after postbacks is important for larger web pages in order to let the user know exactly what is going on.

It is good usability and something you would expect in modern web applications.

In ASP.NET 1.x you were able to do it simply by setting the SmartNavigation property to true on the page.

The problem with SmartNavigation we numerous and did more harm than good.

It was not cross-browser and it could mess up your own JavaScript.

That's part of the reason why it has been deprecated in ASP.NET 2.0.

Instead of SmartNavigation, ASP.NET 2.0 introduced the MaintainScrollPositionOnPostBack property, which does exactly what the name applies. It has a much smaller impact on the output and it is cross-browser compliant.

There are three ways of applying the property to a web page.

Low Rate eCommerce & Retail Plans

You can set it programmatically



This feature is an absolute must-have on large web pages built for postback scenarios.

The beauty of it is the simplicity and the low impact.

Comments


About the Author:
Mads Kristensen currently works as a Senior Developer at Traceworks located in Copenhagen, Denmark. Mads graduated from Copenhagen Technical Academy with a multimedia degree in 2003, but has been a professional developer since 2000. His main focus is on ASP.NET but is responsible for Winforms, Windows- and web services in his daily work as well. A true .NET developer with great passion for the simple solution.

http://www.madskristensen.dk/

About WebProASP
WebProASP is a collection of up to date tutorials and insightful articles designed to help ASP users of any skill level implement successful ASP systems and practices. ASP Strategies and Tactics for Business

WebProASP is brought to you by:

SecurityConfig.com NetworkingFiles.com
NetworkNewz.com WebProASP.com
DatabaseProNews.com SQlProNews.com
ITcertificationNews.com SysAdminNews.com
WebProASP.com WirelessProNews.com
CProgrammingTrends.com ITManagementNews.com




-- WebProAsp is an iEntry, Inc. publication --
iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509
2006 iEntry, Inc.  All Rights Reserved  Privacy Policy  Legal

archives | advertising info | news headlines | free newsletters | comments/feedback | submit article



ASP Strategies and Tactics for Business WebProASP News Archives About Us Feedback WebProASP Home Page About Article Archive News Downloads WebProWorld Forums Jayde iEntry Advertise Contact