I have the following error in C # ' The name' Json 'does not exist in the current context ' in my application. I followed all the steps recommended by various sites, such as adding such references and such, but the error continued.
using System;
using System.Web.Mvc;
using System.IO;
using DevExpress.XtraRichEdit;
namespace PCMSO
{
public partial class pcmso : System.Web.UI.Page
{
[HttpPost]
public JsonResult SalvaTexto(){
try
{
return Json(new { success = true, message = "Salvo!. "}, JsonRequestBehavior.AllowGet);
}
catch (Exception ex)
{
return Json(new { success = false, message = "Não foi possível salvar o documento. " + ex.Message }, JsonRequestBehavior.AllowGet);
}
}
}
}