C# MVC fix for IE behaving badly with JSON


SUBMITTED BY: Guest

DATE: April 25, 2013, 9:59 a.m.

FORMAT: Text only

SIZE: 315 Bytes

HITS: 1110

  1. protected new JsonResult Json(object data)
  2. {
  3. if (Request != null && !Request.AcceptTypes.Contains("application/json"))
  4. {
  5. return base.Json(data, "text/plain");
  6. }
  7. return base.Json(data);
  8. }

comments powered by Disqus