Controller.Content Method

Definition

Overloads

Content(String)

Creates a content result object by using a string.

Content(String, String)

Creates a content result object by using a string and the content type.

Content(String, String, Encoding)

Creates a content result object by using a string, the content type, and content encoding.

Content(String)

Creates a content result object by using a string.

protected internal System.Web.Mvc.ContentResult Content(string content);

Parameters

content
String

The content to write to the response.

Returns

The content result instance.

Applies to

ASP.NET MVC 5.2
Product Versions
ASP.NET MVC 5.2

Content(String, String)

Creates a content result object by using a string and the content type.

protected internal System.Web.Mvc.ContentResult Content(string content, string contentType);

Parameters

content
String

The content to write to the response.

contentType
String

The content type (MIME type).

Returns

The content result instance.

Applies to

ASP.NET MVC 5.2
Product Versions
ASP.NET MVC 5.2

Content(String, String, Encoding)

Creates a content result object by using a string, the content type, and content encoding.

protected internal virtual System.Web.Mvc.ContentResult Content(string content, string contentType, System.Text.Encoding contentEncoding);

Parameters

content
String

The content to write to the response.

contentType
String

The content type (MIME type).

contentEncoding
Encoding

The content encoding.

Returns

The content result instance.

Applies to

ASP.NET MVC 5.2
Product Versions
ASP.NET MVC 5.2