ASP. Net advanced: SiteMapPath, TreeView

Source: Internet
Author: User

Understand the SiteMapPath control. The SiteMapPath data comes from the site map file. Note: Only pages listed in the site map can display navigation data in the SiteMapPath control. If you place the SiteMapPath control on a page not listed on the site map, the control does not display any information to the client. Example: The dynamic Web page used: Add a SiteMapPath control on each page and add a Web. sitemap site map file. In the site map, <siteMap xmlns =" http://schemas.microsoft.com/AspNet/SiteMap-File-1.0 "> <SiteMapNode url =" default1.aspx "title =" Homepage "description =" "> <siteMapNode url =" tiyu. aspx "title =" Sports "description =" click to enter sports "> <siteMapNode url =" Guoneitiyu. aspx "title =" domestic sports "description =" "/> <siteMapNode url =" aoyunhui. aspx "title =" Olympics "description =" "/> <siteMapNode url =" zuqiu. aspx "title =" "description =" "/> </siteMapNode> <siteMapNode url =" caijin. aspx "title =" finance "description =" "> <siteMapNode Url = "gupiao. aspx "title =" stock "description =" "/> <siteMapNode url =" dichan. aspx "title =" "description =" "/> </siteMapNode> <siteMapNode url =" qiche. aspx "title =" "description =" "/> </siteMapNode> </siteMap> the TreeView control displays navigation information in a tree structure, you can control the style and behavior of each node in the number. When a program is used to dynamically fill the TreeView control, recursion is generally required. Example: The dynamic web page used: 1ASPDotNet. aspx2java. aspx3php. aspxdefault. aspxDemo2.aspxindex. aspxjavaTerm1.aspx adds a TreeView control (select the data source SiteMapDataSource1) and SiteMapDataSource data source on each page, and adds a Web. sitemap: <siteMap xmlns =" http://schemas.microsoft.com/AspNet/SiteMap-File-1.0 "> <SiteMapNode url =" default. aspx "title =" Homepage "description =" "> <siteMapNode url =" 1ASPDotNet. aspx "title =" Net direction "description =" "> <siteMapNode url =" NetTerm1.aspx "title =" Net direction first semester "description =" "> <siteMapNode url =" NetTerm1C1. aspx "title =" first semester course 1htmlcss and js "description =" "/> <siteMapNode url =" NetTerm1Course2. aspx "title =" first semester course 2C # "description =" "/> </siteMapNode> <siteMapNode url =" NetTerm2.aspx "title =" Net to second semester "description = "" /> </siteMapNode> <siteMapNode url = "2java. aspx "title =" Java direction "description =" "> <siteMapNode url =" javaTerm1.aspx "title =" java direction first semester "description =" "/> <siteMapNode url =" JavaTerm2.aspx "title =" java to the second semester "description =" "/> </siteMapNode> <siteMapNode url =" 3php. aspx "title =" Php direction "description =" "/> </siteMapNode> </siteMap>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.