Table of Contents

Class JsonResult

Namespace
System.Web.Mvc
Assembly
System.Web.Mvc.dll

Represents a class that is used to send JSON-formatted content to the response.

public class JsonResult : ActionResult
Inheritance
JsonResult
Inherited Members

Constructors

JsonResult()

Initializes a new instance of the JsonResult class.

public JsonResult()

Properties

ContentEncoding

Gets or sets the content encoding.

public Encoding ContentEncoding { get; set; }

Property Value

Encoding

The content encoding.

ContentType

Gets or sets the type of the content.

public string ContentType { get; set; }

Property Value

string

The type of the content.

Data

Gets or sets the data.

public object Data { get; set; }

Property Value

object

The data.

JsonRequestBehavior

Gets or sets a value that indicates whether HTTP GET requests from the client are allowed.

public JsonRequestBehavior JsonRequestBehavior { get; set; }

Property Value

JsonRequestBehavior

A value that indicates whether HTTP GET requests from the client are allowed.

MaxJsonLength

Gets or sets the maximum length of data.

public int? MaxJsonLength { get; set; }

Property Value

int?

The maximum length of data.

RecursionLimit

Gets or sets the recursion limit.

public int? RecursionLimit { get; set; }

Property Value

int?

The recursion limit.

Methods

ExecuteResult(ControllerContext)

Enables processing of the result of an action method by a custom type that inherits from the ActionResult class.

public override void ExecuteResult(ControllerContext context)

Parameters

context ControllerContext

The context within which the result is executed.

Exceptions

ArgumentNullException

The context parameter is null.