Reputation: 5702
Does ASP.NET support exposing Web.sitemap as a sitemap.xml for google to use?
Upvotes: 1
Views: 797
Reputation: 675
Not out of the box, but it certainly is possible.
Basically, to tackle this project, you will need to break it down into the following phases.
To get step 1 done, you need to do research on how to do this based on the IIS version you will be hosting in. IIS6 and IIS7 Classic mode will yield different implementation logic for IIS7 Integrated mode... more hoops to go through for the former IIS server configurations.
Once you have a request going through ASP.NET process where you are able to wire up a HTTP handler, or if you are using MVC, a route, then you are able to proceed with pumping out the XML.
First step would be able to transpose the data in your web.sitemap file. To do this, you need to access the SiteMap class. (http://msdn.microsoft.com/en-us/library/system.web.sitemap_members(v=VS.85).aspx).
Then lastly, you just need to spit it out. Maybe just use Linq to XML for it... but that is just a pretty straight forward task.
Upvotes: 1