Is Response.End() considered harmful?

前端 未结 9 922
陌清茗
陌清茗 2020-11-22 01:01

This KB Article says that ASP.NET\'s Response.End() aborts a thread.

Reflector shows that it looks like this:

public void End()
{
            


        
9条回答
  •  暖寄归人
    2020-11-22 01:56

    I've never considered using Response.End() to control program flow.

    However Response.End() can be useful for example when serving files to a user.

    You have written the file to the response and you don't want anything else being added to the response as it may corrupt your file.

提交回复
热议问题