Basically I am trying to use the new MVC5 routing attribute to redirect /sitemap.xml to a method as I need to dynamically create it.
// GET: /sitemap.xml
[Route("sitemap.xml")]
public ActionResult SiteMap()
{
// Stuff
}
At the moment that doesn't work so is it possible to do it like this or will I have to use the routing table like I did before?
routes.MapRoute(
name: "Site Map",
url: "sitemap.xml",
defaults: new { controller = "Default", action = "SiteMap" });