Unleash the power of .Net

Rendering views to strings

Rendering a view or a partial to a string is a common problem, especially when you want to re-use your code and markup in a PDF or Email. There are a number of semi-successful methods for achieving this across the internet. The techniques outlined below are built on the excellent post from Kevin Craft at http://craftycodeblog.com/2010/05/15/asp-net-mvc-render-partial-view-to-string/ this has the advantage of being simple, straight forward and fully support embedded Html helpers.