从 ViewResult 获取结果 HTML
我想从其中获取结果 HTML我的控制器操作,只需将结果作为 HTML 格式的电子邮件发送即可。但是,我在尝试弄清楚如何从 ViewResult 获取该 HTML 时遇到困难。
我尝试过的一种方法是实现继承自 ActionFilterAttribute 的 HtmlEmailActionFilter。但我仍然不知道如何从 ResultExecutedContext 获取 HTML。
我走在正确的轨道上吗?如果没有,什么是更好的方法来完成我想要完成的任务?
谢谢。
Possible Duplicates:
Send asp.net mvc action result inside email
Render a view as a string
I would like to obtain the result HTML from one of my controller actions, and simply send the result as a HTML format email. However, I am having difficulties trying to figure out how to obtain that HTML from ViewResult.
One approach I have tried is to implement HtmlEmailActionFilter that inherits from ActionFilterAttribute. But I still don't know how to get the HTML from ResultExecutedContext.
Am I on the right track? If not, what would be a better way to perform what I would like to accomplish?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论