Send asp.net mvc action result inside email

前端 未结 5 2082
礼貌的吻别
礼貌的吻别 2020-12-01 02:04

I\'d like to use my Action in asp.net mvc, as template engine, that results in form of string, that I could send in email.

Pseudo-Code:

public Action         


        
5条回答
  •  执笔经年
    2020-12-01 02:49

    Hey Will, from what I am reading (and my own attempt to implement your solution) the View.Render method completely ignores the writer paramter. The content of my writer is always empty and instead the rendered view gets blurted out in to the response stream. So it seems impossible (or rather convoluted at least) to get your use you views like that. I think in your test case you would see the rendered view twice, and your email would be blank.

    I found some discussion on this here: http://ayende.com/Blog/archive/2008/11/11/another-asp.net-mvc-bug-rendering-views-to-different-output-source.aspx

提交回复
热议问题