ASP.NET Web.sitemap to Generate sitemap.xml [close

2019-07-01 14:03发布

问题:

Anyone know of any programming examples that could be used to convert an asp.net .sitemap file into a google sitemap.xml file? You'd think this would be an easy process but I can't seem to find any example online.

Basically what I want to do is setup a handler so that will run whenever someone goes to http://www.mydomain.com/sitemap.xml.

I've already figured out how to do that. I just need the code that will convert the web.sitemap xml into the sitemap.xml syntax.

回答1:

I always prefer doing my own code, rather than use a library, where possible and did this some time ago - can't find the code right now, though this tutorial will get you going. It basically reads the sitemap and then uses the information to create a new google sitemap.

you can also extend it to add in any pages you may have in a database. Skies the limit really :)

It's in both C# and VB

Here is the tutorial | dynamic create google sitemap aspnet