I am trying to scan through my site and catalog all content. To do this, I need to
- Find all Views (probably as Controller / Action Combinations)
- render all my Views to strings
To crawl my own site, I have implemented this sitemap provider. So I have an xml file like this:
<?xml version="1.0" encoding="utf-8" ?>
<mvcSiteMap xmlns="http://mvcsitemap.codeplex.com/schemas/MvcSiteMap-File-3.0"
enableLocalization="false">
<mvcSiteMapNode title="Home" controller="Home" action="Index"
changeFrequency="Always" updatePriority="Normal">
<mvcSiteMapNode title="Dashboard" controller="Home" action="Dashboard"/>
<mvcSiteMapNode title="My Profile" controller="Profile" action="MyProfile"/>
<mvcSiteMapNode title="My Jobs" controller="Profile" action="MyJobs"/>
</mvcSiteMapNode>
</mvcSiteMap>
that I can convert to a list using linq-to-xml.
I intended to convert each view to a string by using the RenderViewToString common approach.
Unfortunately, this works better when you want to render a particular View to a String. When you don't know the specific model/controller in advance.
In conclusion: Is there a way to render a view to string only having Controller and Action names as strings?