Writing to Output Stream from Action

前端 未结 5 730
悲&欢浪女
悲&欢浪女 2020-11-29 04:13

For some strange reasons, I want to write HTML directly to the Response stream from a controller action. (I understand MVC separation, but this is a special case.)

C

5条回答
  •  没有蜡笔的小新
    2020-11-29 04:36

    You can do return Content(...); where, if I remember correctly, ... would be what you want to write directly to the output stream, or nothing at all.

    Take a look at the Content methods on the Controller: http://aspnet.codeplex.com/SourceControl/changeset/view/22907#266451

    And the ContentResult: http://aspnet.codeplex.com/SourceControl/changeset/view/22907#266450

提交回复
热议问题