0
I’m using the method:
protected string RenderPartialViewToString(string viewName, object model)
{
if (string.IsNullOrEmpty(viewName))
viewName = ControllerContext.RouteData.GetRequiredString("action");
ViewData.Model = model;
using (StringWriter sw = new StringWriter())
{
ViewEngineResult viewResult = ViewEngines.Engines.FindPartialView(ControllerContext, viewName);
ViewContext viewContext = new ViewContext(ControllerContext, viewResult.View, ViewData, TempData, sw);
viewResult.View.Render(viewContext, sw);
return sw.GetStringBuilder().ToString();
}
}
To turn my view into string, to send by email, however, in the email the view runs out of css, even adding the css in <head>
<link href="~/Content/Site.css" rel="stylesheet" />
<link href="~/Content/bootstrap-custom.css" rel="stylesheet" />
<link href="~/Content/bootstrap.css" rel="stylesheet" />
How do I make css appear in the email ?