MVC 3 compression filter causing garbled output

前端 未结 4 1717
囚心锁ツ
囚心锁ツ 2020-12-28 08:24

So, I have a custom attribute called CompressAttribute which is set up as a global filter in global.asax. It uses reflection to examine the return type of the current action

4条回答
  •  情深已故
    2020-12-28 09:04

    I had this same problem in asp.net mvc 1.0 browsing for a page that had a RenderAction inside (from the futures assembly). Apparently the problem was that the response was being encoded twice. I had to create an action filter for this child actions so that a flag is set in the DataTokens collection of the RouteData. Then I had to modify the compress filter so that it returned in case the flag was set. I also had to deal with the execution order of the filters. Maybe this can help, verify if the compress filter is being called more than one time when an error page is raised.

提交回复
热议问题