"Eyebrow navigation" -- Use of SiteMapPath controls (ASP. NET) and sitemappathasp.net
I used the SiteMapPath control during my website today. I recorded the usage method for future reference and help new friends.
SiteMapPath displays a navigation path (also known as trace navigation or eyebrow navigation), which shows the location of the current webpage and the path to the home page. This control provides many options for customizing the appearance of a link. You can use the "SiteMapPath" control to create website navigation without code and data binding. This control can automatically read and display website chart information.
SiteMapPath usage: 1. first, you must create a site map Web. sitemap (because the SiteMapPath control depends on the site map for display, right-click --> Add new item --> site map --> Add) is best in the root directory
The code in Web. sitemap is as follows:
<? Xml version = "1.0" encoding = "UTF-8"?> <SiteMap xmlns =" http://schemas.microsoft.com/AspNet/SiteMap-File-1.0 "> <SiteMapNode title =" your location "> <siteMapNode url =" index. aspx "title =" Homepage "description =" Please click to go to the Homepage "> <siteMapNode url =" img_News.aspx "title =" "description =" "/> <siteMapNode url = "News. aspx "title =" "description =" "/> <siteMapNode url =" News_work.aspx "title =" "description =" "/> <siteMapNode url = "News_inform.aspx" title = "Public Announcement" description = "Public Announcement"/> <siteMapNode url = "News1.aspx" title = "Economic News" description = "Economic News"/> <siteMapNode url = "News2.aspx" title = "" description = ""/> <siteMapNode url = "News3.aspx" title = "" description = ""/> <siteMapNode url = "jddt. aspx "title =" street dynamics "description =" street Dynamics "/> <siteMapNode url =" zwgk. aspx "title =" "description =" "/> <siteMapNode url =" Leaders. aspx "title =" Leadership "description =" Leadership "/> <siteMapNode url =" jgsz. aspx "title =" institution settings "description =" institution settings "/> <siteMapNode url =" Laws. aspx "title =" policy and regulation "description =" policy and regulation "/> <siteMapNode url =" work. aspx "title =" working dynamics "description =" working dynamics "/> <siteMapNode url =" sqjs. aspx "title =" Community Building "description =" Community Building "/> <siteMapNode url =" sqjs1.aspx "title =" community Introduction "description =" community Introduction "/> <siteMapNode url = "sqjs2.aspx" title = "" description = ""/> <siteMapNode url = "Network. aspx "title =" "description =" "/> <siteMapNode url =" Network1.aspx "title =" description "description =" "/> <siteMapNode url = "Network2.aspx" title = "service process" description = "service process"/> <siteMapNode url = "Network3.aspx" title = "online processing" description = "online processing"/> </siteMapNode> </siteMap>
2. Add the SiteMapPath control to the aspx webpage. (Drag and drop the "SiteMapPath" control from the "toolbox" task pane to the webpage)
The Code on the aspx webpage is as follows:
<Asp: SiteMapPath ID = "SiteMapPath1" runat = "server" style = "font-family: Child circle; font-size: medium "Font-Names =" Verdana "Font-Size =" 0.8em "PathSeparator ="> "> <PathSeparatorStyle Font-Bold =" True "ForeColor =" #990000 "/> <currentNodeStyle ForeColor = "#333333"/> <NodeStyle Font-Bold = "True" ForeColor = "#990000"/> <RootNodeStyle Font-Bold = "True" ForeColor = "# FF8000 "/> </asp: siteMapPath>
For example, if the name of your page is News. aspx, the page displays "your location> homepage> News Dynamics ".
3. The configuration in the web. config file is as follows:
1 <system.web> 2 3 <siteMap defaultProvider="XmlSiteMapProvider" enabled="true"> 4 5 <providers> 6 7 <add name="XmlSiteMapProvider" 8 9 description="SiteMap provider which reads in .sitemap XML files."10 11 type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"12 13 siteMapFile="web.sitemap"/>14 15 </providers>16 17 </siteMap>18 19 </system.web>
4. This completes the eyebrows navigation.