How to render an ASP.NET MVC view as a string?
Here’s what I came up with, and it’s working for me. I added the following method(s) to my controller base class. (You can always make these static methods somewhere else that accept a controller as a parameter I suppose) MVC2 .ascx style protected string RenderViewToString<T>(string viewPath, T model) { ViewData.Model = model; using (var writer … Read more