Dynamic sitemap in ASP.NET MVC

前端 未结 7 637
小蘑菇
小蘑菇 2021-01-30 09:04

I\'m trying to create an automatic sitemap ActionResult that outputs a valid sitemap.xml file. The actual generation of the file is not a problem, but I can\'t seem to figure o

7条回答
  •  -上瘾入骨i
    2021-01-30 09:45

    Have you tried something like this:

    http://blog.maartenballiauw.be/post/2008/08/29/Building-an-ASPNET-MVC-sitemap-provider-with-security-trimming.aspx

    After re-reading your question, I see that you want something a little different than the example I provided. I think you would have to reflect all of the known controllers and their actions to build a sitemap dynamically.

    It would be far simpler to use a database or sitemap file as your source I think.

提交回复
热议问题