将Action的结果渲染为字符串

时间:2011-02-25 16:50:24

标签: asp.net-mvc-3

  

可能重复:
  Render a view as a string

如何将Controller Action的结果呈现为MVC 3中的字符串(所以我可以将它们作为电子邮件发送)?

1 个答案:

答案 0 :(得分:0)

最简单的解决方案可能就是:

string body = Html.Action("Mail").ToHtmlString();