Summary


In this chapter, you have looked at the many ways of implementing navigation within your Web sites and Web applications. You saw how to create simple navigation with hyperlinks using the various HTML and ASP.NET server controls, including the HtmlAnchor, Hyperlink, and various list controls such as BulletedList and treeView.

The difference between navigation and postback affects the way that you implement navigation and the appearance and behavior of the links you provide. This chapter examined the use of the LinkButton and similar controls, both individually and as part of more complex controls, where the default behavior is to cause a postback to the server rather than direct navigation.

Using a postback enables navigation through browser redirection, and there are several techniques for accomplishing thisincluding the Response. Redirect method and the use of client-side code. The converse is also possible, where you implement server-side redirection. In this case, the browser does not reflect the fact that a different page is executing. It also allows you to access the page originally requested, and it may prove useful for modularizing or reusing code in your applications.

The chapter next looked at the rather more specialist technique of cross-page posting form values. In most cases, you will take advantage of the postback architecture of ASP.NET to maintain viewstate and react to page events. However, you can post a form to another page instead and still be able to access the values and controls in the previous page.

Finally, this chapter looked at the specialist navigation features in ASP.NET. Using an XML file to define a site map allows controls such as the Menu, treeView, and SiteMapPath to automatically create the navigation UI for your site. This offers a huge savings on development effort and provides an attractive and usable fly-out, drop-down, or collapsible menu system with a breadcrumb-trail indication of the current page position within the hierarchy of your site.

In the next chapter, you will see how many of these controls also integrate with the security and membership features in ASP.NET.



ASP. NET 2.0 Illustrated
ASP.NET 2.0 Illustrated
ISBN: 0321418344
EAN: 2147483647
Year: 2006
Pages: 147

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