Sdl.Web.Mvc/Controllers/BaseController.cs
/// <summary>
/// Creates a JSON Result which uses the JSON.NET serializer.
/// </summary>
/// <remarks>
/// By default, ASP.NET MVC uses the JavaScriptSerializer to serialize objects to JSON.
/// By overriding this method, we ensure that the (more powerful and faster) JSON.NET serializer is used when <see cref="BaseController"/>-derived
/// controller uses the standard ASP.NET MVC Json method to return a JSON result.
/// </remarks>.
Creates a JSON Result which uses the JSON.NET serializer.
Creates a JSON Result which uses the JSON . NET serializer .
protected override JsonResult Json(object data, string contentType, Encoding contentEncoding, JsonRequestBehavior behavior)
        {
            return new Sdl.Web.Mvc.Formats.JsonNetResult
            {
                Data = data,
                ContentType = contentType,
                ContentEncoding = contentEncoding,
                JsonRequestBehavior = behavior
            };
        }
protected override JsonResult Json ( object data , string contentType , Encoding contentEncoding , JsonRequestBehavior behavior ) { return new Sdl . Web . Mvc . Formats . JsonNetResult { Data = data , ContentType = contentType , ContentEncoding = contentEncoding , JsonRequestBehavior = behavior } ; }
Creates a JSON Result which uses the JSON.NET serializer.
Creates a JSON Result which uses the JSON . NET serializer .
data
object
contentType
string
contentEncoding
Encoding
behavior
JsonRequestBehavior
remarks
By default, ASP.NET MVC uses the JavaScriptSerializer to serialize objects to JSON.
By overriding this method, we ensure that the (more powerful and faster) JSON.NET serializer is used when .
derived
controller uses the standard ASP.NET MVC Json method to return a JSON result.
By default ASP . NET MVC uses the JavaScriptSerializer to serialize objects to JSON . By overriding this method we ensure that the ( more powerful and faster ) JSON . NET serializer is used when . derived controller uses the standard ASP . NET MVC Json method to return a JSON result .