MVC by default does not allow the methods to be fetched directly which does return a JSON result due to security reasons. Request behavior shall be marked explicitly to allow to do a get operation.
return Json(data, JsonRequestBehavior.AllowGet)
Once you add this "JsonRequestBehavior.AllowGetOn" it allows to do a get operation to return the JSON result to browser.
No comments:
Post a Comment