Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

A La Carte, Part 2: Build Deep, Flexible Navigation Using Four New Controls : Page 2

In part 1, we looked in depth at ASP.NET's new Menu control. But ASP.NET 2.0 includes a whole family of controls that make it easy to create deep, complex, and highly-professional navigational elements, including a "bread crumb" style control that will keep your visitors oriented.


advertisement
Customizing the SiteMapPath Control
The default view of the SiteMapPath control displays the navigation path using the string contained in the title attribute of the <siteMapNode> element in the site map file (Listing 1). Each navigation path is separated by the ">" character.

Figure 7. Enhanced Bread Crumb: Customizing the look and feel of the SiteMapPath control.
You can customize the look and feel of the SiteMapPath control by adding style information to it. For example, you can add images or enhanced text. The following code overrides the default path separator by using an Image control. It also highlights the current path using a light green background color.



<asp:SiteMapPath ID="SiteMapPath2" Font-Name="Garamond" Font-Size="12pt" RunAt="server"> <CurrentNodeStyle Height="24px" BackColor="LightGreen" Font-Bold="true" /> <NodeStyle Height="24px" /> <PathSeparatorTemplate> <ItemTemplate> <asp:Image ID="Image2" ImageUrl="~/images/arrow.gif" RunAt="server" /> </ItemTemplate> </PathSeparatorTemplate> </asp:SiteMapPath>

Figure 7 shows what the SiteMapPath control looks like with the above modification.



Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap