MVC中调用Public_Class时,VS2012老提示:当前上下文中不存在名称“Json”的解决方法

TMD,老TMD困扰我,每次新建MVC项目后就提示这个,原因在此:

public class Public_Class   《==此处应为:Public_Class : Controller

{

public JsonResult ResultJson(string code, string message, string tbId, string callbackType, string url, string o1, string o2)
{
return Json(new
{
...

}, JsonRequestBehavior.AllowGet);
}

}

另外要记得引用using System.Web.Mvc;

 

posted on 2016-03-04 14:07  GameMan  阅读(499)  评论(0编辑  收藏  举报

导航