Render View as String ASP.NET MVC 3/4
using System.IO;using System.Web.Mvc;public class RenderRazorViewToString{ #region Render public string Render( Controller controller, string viewName, object model ) { controller.ViewData.Model = model; using ( var sw = new StringWriter() ) { …
Continuar lendo