return Json error from ASP.NET MVC

后端 未结 4 1898
悲&欢浪女
悲&欢浪女 2020-12-13 06:11

I\'m trying to return an error message via Json from ASP.NET MVC controller. I want to display carriage returns on the screen, so the error will look like:

4条回答
  •  心在旅途
    2020-12-13 06:46

    Yea, you're defeating the purpose like @Hector said..

    And if you want to return true JSON, maybe try returning a Json(Dictionary) instead of a Json(string).

提交回复
热议问题