Json does not exist in the namespace System

前端 未结 5 907
野趣味
野趣味 2020-12-06 00:19

In this tutorial: http://www.asp.net/web-api/videos/getting-started/custom-validation Jon uses

dynamic error = new JsonObject();

with

5条回答
  •  广开言路
    2020-12-06 01:00

    The Json object works only from Controller class and not outside. Even if we refer System.Web.MVC outside controller, we have access only to JsonResult and not to Json as Json object is protected object of JsonResult. Please refer the below documentation which explains that,

    http://msdn.microsoft.com/en-us/library/dd504936(v=vs.118).aspx

提交回复
热议问题