Return JSON with error status code MVC

前端 未结 11 1750
隐瞒了意图╮
隐瞒了意图╮ 2020-11-27 13:23

I was trying to return an error to the call to the controller as advised in This link so that client can take appropriate action. The controller is called by javascript via

11条回答
  •  暖寄归人
    2020-11-27 13:52

    The thing that worked for me (and that I took from another stackoverflow response), is to set the flag:

    Response.TrySkipIisCustomErrors = true;
    

提交回复
热议问题