I want to get all the renderings of a content item and render each of them to html string inside an MVC action using C# code. Below is the code I am using to get all the renderings of a content item.
Item item = Sitecore.Context.Database.GetItem(someItem);
RenderingReference[] myRenderings = item.Visualization.GetRenderings(Sitecore.Context.Device, true);
foreach (RenderingReference rendering in myRenderings)
{
RenderingItem renderingItem = rendering.RenderingItem;
}
I am able to get this list and the rendering item's Id. But how can i render them to html string here?
Note: the renderings could be of any rendering type like view renderings, xsl renderings , controller renderings etc. I dont want to use the approach of WebClient or HtmlAgility pack.