2010-12-07 115 views

回答

5

您会通过向请求发送多个响应来破坏HTTP标准。

但是,您可以使用Transfer-Encoding“chunked”,它在多个部分中发送响应。在常规的ASP.Net中,您将使用Response.Flush()来实现此目的。

我想你必须执行ActionResult并用响应对象手动发送,以便能够以相同的响应发送多个部分。

0

静态成员坚持跨越多个请求,所以你可以这样做:

public static class HttpHandlerStorage 
{ 
    // this should still be here, unless the HttpApplication reloads. 
    public static IHttpHandler StoredHandler { get; set; } 
} 

然而,你的HttpContext将获得在请求结束时被销毁。