Chapter 7Navigation
WHAT YOU WILL LEARN IN THIS CHAPTER:
- How to move around in your site using server controls and plain HTML
- How to address pages and other resources like images
- How to use the ASP.NET
Menu, TreeView
, andSiteMapPath
navigation controls - How to use ASP.NET’s routing capabilities
- How to send users from one page to another programmatically
WROX.COM CODE DOWNLOADS FOR THIS CHAPTER
You can find the wrox.com code downloads for this chapter on the Download Code tab at www.wrox.com/go/begaspnet451. The code is in the Chapter 7 folder.
When your site contains more than a handful of pages, it’s important to have a solid and clear navigation structure that enables users to find their way around your site. If you implement a good navigation system, all the disconnected web pages in your project form a complete and coherent website.
When you think about important parts of a navigation system, the first thing that you may come up with is a menu. Menus come in all sorts and sizes, ranging from simple and static HTML links to complex, fold-out menus driven by CSS or JavaScript. But there’s more to navigation than menus alone. ASP.NET comes with a number of useful navigation controls that enable you to set up a navigation system in no time. These controls include the Menu, TreeView
, and SiteMapPath
, which you learn about in this chapter.
Besides visual controls like Menu
, navigation is also about structure. A well-organized site is easy for your users to navigate. The
Get Beginning ASP.NET 4.5.1: in C# and VB now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.