HttpContext throws HttpException

前端 未结 7 647
无人共我
无人共我 2020-12-05 18:30

I have written a custom http handler. I have done this by writing a class which implements the IHttphandler.

Inside that class I have code like this,



        
7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-05 19:18

    Take out both the Flush() and Close() call. You really don't need them. Once your handler is done, it'll exit, and ASP.NET will handle closing the request.

    Besides, Flush() should be used when you're streaming content to the client (adding parts to the response stream in blocks). You don't need to use it with TransmitFile().

提交回复
热议问题