Make a site sitemap using the Sitemap tool that comes with ASP.

Source: Internet
Author: User
Tags map class

Sitemap very convenient to quickly give us the navigation we want to visit the address, can be categorized according to the hierarchical relationship, to the user a very good user experience, very good to see their current site location

A sitemap, also known as a sitemap, is a page that places links to all pages on the site. Most people may use the site map as a remedy when they cannot find the information they need on the site. Search engine spiders like site map very much.

A site map is a container for all links to a site. A lot of Web site connection level is deep, spiders difficult to crawl, site map can be convenient search engine Spider crawl Site page, crawl Site page, clear understanding of the structure of the site, the site map is generally stored in the root directory and named Sitemap, for search engine spider finger Road, increase the site of important content pages. Site map is based on the structure of the site, framework, content, generated navigation Web site map

For example

The use of ASP development site map is actually very simple, it provides a sitemap Sitemap This class, the following is the use of ASP. NET site Map class, produced by the site map

1 new 4 Web Forms for location jumps and classifications, one Sitemap class Web.sitemap

2. Open Web.sitemap, will generate a batch of code by default, you just need to add the address and the title on the line

1<?xml version="1.0"encoding="Utf-8"?>2<sitemap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0">3<sitemapnode url="WebForm1.aspx"title="Home Page"description="">4<sitemapnode url="webform2.aspx"title="Shopping"description=""/>5<sitemapnode url="webform3.aspx"title="Books"description="">6<sitemapnode url="webform4.aspx"title="Chinese Literature"description=""/>7</siteMapNode>8</siteMapNode>9</siteMap>Ten //URL is the address you want to link, the title of your link address (also the text displayed in the location), description asked the link descriptive text

Attention:

SiteMapNode is equivalent to the root node, if you want to add a byte point inside the root node only in the <siteMapNode> <siteMapNode/> tag add <sitemapnode url= " Webform2.aspx "title=" shopping "  description=" "/>; add multilevel can also be in this way;

2. Then add a SiteMapPath control in each Web form to display;
Take webform4.aspx For example, in fact the other like it, no need to tangle
1<%@ Page language="C #"autoeventwireup="true"Codebehind="WebForm4.aspx.cs"inherits="The tenth chapter of the site map. WEBFORM4"%>2 3<! DOCTYPE html>4 5"http://www.w3.org/1999/xhtml">6"Server">7<meta http-equiv="Content-type"Content="text/html; Charset=utf-8"/>8<title></title>9Ten<body> One<form id="Form1"runat="Server"> A<div> -      -<asp:sitemappath id="SiteMapPath1"runat="Server"> the</asp:SiteMapPath>//SiteMapPath server Controls -      -</div> -</form> +</body> -

3. Take webform4.aspx as a test

is not very simple, but I try not to do this with the Sitemap control to do this, God horse did not do the great God has this practice welcome comments or Private chat

Make a site sitemap using the Sitemap tool that comes with ASP.

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.