c# in visual studio 2013 impossible to convert implicitly the type "string" in System.Web.Mvc.JsonResult

  Uncategorised

it says in visual studio impossible to convert implicitly the type "string" in System.Web.Mvc.JsonResult:
so i want to escape the character "<" and i add this line:result = WebUtility.HtmlDecode("<");
but it treturns an error;

public JsonResult GetJsonForQuery(ObjectJson serializedJson) {

            if (serializedJson.MainObjects == null){
                JsonResult result = Json(new { updated = DateTime.UtcNow.ToString("o"), errorNoItemSelected = true, }, JsonRequestBehavior.AllowGet);
                result.MaxJsonLength = Int32.MaxValue;
                result = WebUtility.HtmlDecode("&lt;"); //this is the line with the error
                return result;
                
            }

Source: Visual Studio Questions

LEAVE A COMMENT