Click here to Skip to main content
15,896,425 members
Articles / Web Development / ASP.NET

Simple Sitemaps in ASP.NET

Rate me:
Please Sign up or sign in to vote.
4.62/5 (7 votes)
21 Apr 20074 min read 98.4K   2.1K   61  
Easiest way to create sitemaps for Google, Yahoo, and Ask. Provides a simple class which implements an XML sitemap file and the search engine ping.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Super Simple Sitemap Library</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <span style="font-size: 10pt; font-family: Verdana"><strong><span style="font-size: 16pt;
            font-family: Tahoma"> Simple Sitemap Library</span></strong><br />
            <br />
            Author: Nathan Buggia &lt;<a href="http://nathanbuggia.com">nathanbuggia.com</a>&gt;<br />
            Date: 4/15/2007<br />
            <br />
            Enclosed is a really basic implementation of the sitemap protocol to get people
            started adding sitemaps to their ASP.Net application. I've included support for
            dynamically generating sitemaps, as well as pinging the major search engines that
            support sitemaps: Google, Yahoo, Live Search (formerly MSN Search), and Ask.com.
            Click one of the tasks below to try it out.<br />
            <br />
        </span>
        <ol>
            <li><span style="font-size: 10pt; font-family: Verdana"><strong><a href="sitemap.ashx">
                Sample dynamically generated sitemap file</a></strong></span></li>
            <li><span style="font-size: 10pt; font-family: Verdana"><strong><a href="ping.aspx">
                Sample ping</a></strong></span></li>
        </ol>
    </div>
        <span style="font-size: 10pt; font-family: Verdana">
            <div>
                I also included a few notes on implementing sitemaps in your application:
            </div>
        </span>
        <div>
            <ul>
                <li><span><span style="font-family: Verdana"><span style="font-size: 10pt"><strong>Don't
                    forget to add the "sitemap:" directive to your Robots.txt file</strong> - instead
                    of registering your sitemap with every search engine, you can support all of them
                    by adding one line to your Robots.txt file, "Sitemap: <em>&lt;fully qualified path to
                        your sitemap file, or sitemap index file&gt;</em>". 
                    <br />
                    <span style="color: #ffffff">_</span></span></span></span></li><li><span></span><span style="font-family: Verdana"><span style="font-size: 10pt"><span>
                    <strong>Sitemaps are a suggestion,
                    not a command</strong> - the search engines will take all of the information provided
                    by your sitemaps as one of many inputs into determining what pages should be included
                    in their index, what is the reletive priority of each page on your site, and how
                    frequently your pages should be crawled.</span>
      <br />
      <span style="color: #ffffff">_</span></span></span></li><li><span><span style="font-family: Verdana"><span style="font-size: 10pt"><strong>Generally, sitemaps
                will not impact your page rank</strong> - they are most likely to affect the number
                of pages that are crawled and indexed, as well as the speed at which they are indexed.
                However, there are some cases where sitemaps have significantly impacted the page
                rank of a site, and that is when the sites were not getting fully crawled, and the
                sitemap led to the inclusion of some really good content into the index.</span></span></span>
      <br />
      <span style="color: #ffffff">_</span></li><li><span></span><span style="font-family: Verdana"><span style="font-size: 10pt"><strong>
                    Give your converting pages the highest priority</strong> - product pages, newsletter
                    signup pages and other pages that generate the most value from your customers should
                    recieve the highest priority. Also include the pages that you know your customers
                    will be the most interested in. &nbsp;</span></span>
      <br />
      <span style="color: #ffffff">_</span></li><li><span style="font-family: Verdana"><span style="font-size: 10pt"><strong>Don't give
                    all your pages 1.0 priority</strong> - this just tells all the search engines that
                    all your pages are of equal importance, it doesn't help boost the importance of
                    any of your pages specifically.</span></span>
      <br />
      <span style="color: #ffffff">_</span></li><li><span style="font-family: Verdana"><span style="font-size: 10pt"><strong>Give sitemaps
                    time to see impact</strong> - you may not see an impact right away from implementing
                    sitemaps, but that doesn't mean that they are not being used. Search engines are
                    still optimizing their implementations and figureout how exactly to use all of this
                    information.</span></span></li>
            </ul>
        </div>
        <span>
            <br />
        </span>
    </form>
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Marketing
United States United States
Hello, I have been working in various aspects of web technology since my first web dev job in 1997, doing PERL and CGI. Since then I have worked in Java, C++/CGI (no, really), Systems Administration, Systems Architecture, and finally moved into Marketing for Microsoft's Live Search.

You can also find me at my blog: nathanbuggia.com

Comments and Discussions