<p>I'm trying to generate a sitemap.xml on the fly for a particular asp.net website.</p>
<p>I found a couple solutions:<br /></p>
<ol>
<li><a href="http://sitemap.chinookwebs.com/" rel="nofollow noreferrer">chinookwebs</a></li>
<li><a href="http://web.archive.org/web/20080307061444/http://www.cervoproject.info:80/sitemaps.aspx" rel="nofollow noreferrer">cervoproject</a></li>
<li><a href="http://www.codeplex.com/Sitemaps" rel="nofollow noreferrer">newtonking</a></li>
</ol>
<p>Chinookwebs is working great but seems a bit inactive right now and it's impossible to personalize the &quot;priority&quot; and the &quot;changefreq&quot; tags of each and every page, they all inherit the same value from the config file.</p>
<p>What solutions do you guys use?</p>

[{'answer_id': 9360, 'author': 'Nick Berardi', 'author_id': 17, 'author_profile': 'https://Stackoverflow.com/users/17', 'pm_score': 0, 'selected': False, 'text': '<p>Custom handler to generate the sitemap.  </p>\n'}, {'answer_id': 9382, 'author': 'Matt Mitchell', 'author_id': 364, 'author_profile': 'https://Stackoverflow.com/users/364', 'pm_score': 0, 'selected': False, 'text': '<p>Using ASP.NET MVC just whipped up a quick bit of code using the .NET XML generation library and then just passed that to a view page that had an XML control on it.  In the code-behind I tied the control with the ViewData.  This seemed to override the default behaviour of view pages to present a different header.</p>\n'}, {'answer_id': 9533, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 4, 'selected': True, 'text': '<p>Usually you\'ll use an <a href="http://www.google.com/search?q=HTTPHandler+ASP.NET&amp;spell=1" rel="noreferrer">HTTP Handler</a> for this. Given a request for...</p>\n\n<blockquote>\n  <p><a href="http://www.yoursite.com/sitemap.axd" rel="noreferrer">http://www.yoursite.com/sitemap.axd</a></p>\n</blockquote>\n\n<p>...your handler will respond with a formatted XML sitemap. Whether that sitemap is generated on the fly, from a database, or some other method is up to the HTTP Handler implementation.</p>\n\n<p>Here\'s roughly what it would look like:</p>\n\n<pre><code>void IHttpHandler.ProcessRequest(HttpContext context)\n{\n    //\n    // Important to return qualified XML (text/xml) for sitemaps\n    //\n    context.Response.ClearHeaders();\n    context.Response.ClearContent();\n    context.Response.ContentType = "text/xml";\n    //\n    // Create an XML writer\n    //\n    XmlTextWriter writer = new XmlTextWriter(context.Response.Output);\n    writer.WriteStartDocument();\n    writer.WriteStartElement("urlset", "http://www.sitemaps.org/schemas/sitemap/0.9");\n    //\n    // Now add entries for individual pages..\n    //\n    writer.WriteStartElement("url");\n    writer.WriteElementString("loc", "http://www.codingthewheel.com");\n    // use W3 date format..\n    writer.WriteElementString("lastmod", postDate.ToString("yyyy-MM-dd"));\n    writer.WriteElementString("changefreq", "daily");\n    writer.WriteElementString("priority", "1.0");\n    writer.WriteEndElement();\n    //\n    // Close everything out and go home.\n    //\n    result.WriteEndElement();\n    result.WriteEndDocument();\n    writer.Flush();\n}\n</code></pre>\n\n<p>This code can be improved but that\'s the basic idea.</p>\n'}]
['https://Stackoverflow.com/questions/9336', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/296/']