I try to convert Razor view into string and i am getting result but it doesn't rendering the css and bootstrap classes.
below is my code which i am trying ...
private string ConvertViewToString(string viewName, object model)
{
ViewData.Model = model;
using (StringWriter writer = new StringWriter())
{
ViewEngineResult viewResult = ViewEngines.Engines.FindPartialView(ControllerContext, viewName);
ViewContext viewContext = new ViewContext(this.ControllerContext, viewResult.View, ViewData, new TempDataDictionary(), writer);
viewResult.View.Render(viewContext, writer);
viewResult.ViewEngine.ReleaseView(ControllerContext, viewResult.View);
return writer.GetStringBuilder().ToString();
}
}
Any help...??