WeavyController.Json Method

Namespace:
Weavy.Web.Controllers
Assembly:
Weavy.Web.dll

Overloads

Json(Object) Creates a JsonResult object that serializes the specified object to JavaScript Object Notation (JSON).
Json(Object, JsonRequestBehavior) Creates a JsonResult object that serializes the specified object to JavaScript Object Notation (JSON) format using the specified JSON request behavior.

Json(Object)

Creates a JsonResult object that serializes the specified object to JavaScript Object Notation (JSON).

The data in the data parameter must be serializable. The JsonConvert class is used to serialize the object. The result object that is prepared by this method is written to the response by the ASP.NET MVC framework when the object is executed.

public JsonResult Json(object data)

Parameters

data
System.Object

Returns

System.Web.Mvc.JsonResult

The JSON result object that serializes the specified object to JSON format.

Json(Object, JsonRequestBehavior)

Creates a JsonResult object that serializes the specified object to JavaScript Object Notation (JSON) format using the specified JSON request behavior.

The data in the data parameter must be serializable. The JsonConvert class is used to serialize the object. The result object that is prepared by this method is written to the response by the ASP.NET MVC framework when the object is executed.

public JsonResult Json(object data, JsonRequestBehavior behavior)

Parameters

data
System.Object
behavior
System.Web.Mvc.JsonRequestBehavior

Returns

System.Web.Mvc.JsonResult