Smart Navigation


Smart Navigation is one of the coolest new features of ASP.NET, giving Web applications a look and feel more like those of conventional Windows applications. One of the drawbacks of Web applications is the architecture of HTTP, requiring postback to the server and a complete redrawing of the page being viewed . Not only does this cause the screen to 'flash', but for long pages it also scrolls you to the top of the page, changes control focus, and so on. With Windows applications, users are used to areas of screen content being updated without the rest of the page being affected. Smart Navigation brings this to Web applications.

The first thing to note is that this is an Internet Explorer feature only, requiring IE 5 or higher. While one of the main goals of ASP.NET is to target HTML 3.2, allowing great cross-browser compatibility, there are plenty of cases where this isn't an issue. One such case is intranets , where the browser can be controlled. However, Smart Navigation can be set to enabled or disabled at will, without affecting the application in any way. Even if you are targeting multiple browsers, Smart Navigation can remain enabled, as it detects the browser and only enables itself for supported browsers.

The four features of Smart Navigation are:

  • No more screen flash.

  • Scroll position maintained .

  • Element focus maintained.

  • Last page in History maintained.

This feature is really targeted at those applications that require a lot of postback, but where the content doesn't change a great deal.

Perhaps the most amazing thing about this feature is that you don't actually have to do any coding. Smart navigation is controlled by a Page directive for individual pagesand including the same in the Web.Config file for entire applications. For the Page directive, the syntax is:

  <%@ Page SmartNavigation="true" %>  

For web.config the syntax is:

  <configuration>   <system.web>   <pages smartNavigation="true"/>   </system.web>   </configuration>  

There's no real way to show a screenshot that demonstrates how great this feature is “ try it yourself to see it. It works by loading the page into a hidden IFRAME , and then only rendering those parts of the page that have changed.




Professional ASP. NET 1.1
Professional ASP.NET MVC 1.0 (Wrox Programmer to Programmer)
ISBN: 0470384611
EAN: 2147483647
Year: 2006
Pages: 243

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net