Share via


PageModel.Content Method

Definition

Overloads

Content(String)

Creates a ContentResult object with Status200OK by specifying a content string.

Content(String, MediaTypeHeaderValue)

Creates a ContentResult object with Status200OK by specifying a content string and a contentType.

Content(String, String)

Creates a ContentResult object with Status200OK by specifying a content string and a content type.

Content(String, String, Encoding)

Creates a ContentResult object with Status200OK by specifying a content string, a contentType, and contentEncoding.

Content(String)

Source:
PageModel.cs
Source:
PageModel.cs
Source:
PageModel.cs

Creates a ContentResult object with Status200OK by specifying a content string.

public:
 virtual Microsoft::AspNetCore::Mvc::ContentResult ^ Content(System::String ^ content);
public virtual Microsoft.AspNetCore.Mvc.ContentResult Content (string content);
abstract member Content : string -> Microsoft.AspNetCore.Mvc.ContentResult
override this.Content : string -> Microsoft.AspNetCore.Mvc.ContentResult
Public Overridable Function Content (content As String) As ContentResult

Parameters

content
String

The content to write to the response.

Returns

The created ContentResult object for the response.

Applies to

Content(String, MediaTypeHeaderValue)

Source:
PageModel.cs
Source:
PageModel.cs
Source:
PageModel.cs

Creates a ContentResult object with Status200OK by specifying a content string and a contentType.

public:
 virtual Microsoft::AspNetCore::Mvc::ContentResult ^ Content(System::String ^ content, Microsoft::Net::Http::Headers::MediaTypeHeaderValue ^ contentType);
public virtual Microsoft.AspNetCore.Mvc.ContentResult Content (string content, Microsoft.Net.Http.Headers.MediaTypeHeaderValue contentType);
public virtual Microsoft.AspNetCore.Mvc.ContentResult Content (string content, Microsoft.Net.Http.Headers.MediaTypeHeaderValue? contentType);
abstract member Content : string * Microsoft.Net.Http.Headers.MediaTypeHeaderValue -> Microsoft.AspNetCore.Mvc.ContentResult
override this.Content : string * Microsoft.Net.Http.Headers.MediaTypeHeaderValue -> Microsoft.AspNetCore.Mvc.ContentResult
Public Overridable Function Content (content As String, contentType As MediaTypeHeaderValue) As ContentResult

Parameters

content
String

The content to write to the response.

contentType
MediaTypeHeaderValue

The content type (MIME type).

Returns

The created ContentResult object for the response.

Applies to

Content(String, String)

Source:
PageModel.cs
Source:
PageModel.cs
Source:
PageModel.cs

Creates a ContentResult object with Status200OK by specifying a content string and a content type.

public:
 virtual Microsoft::AspNetCore::Mvc::ContentResult ^ Content(System::String ^ content, System::String ^ contentType);
public virtual Microsoft.AspNetCore.Mvc.ContentResult Content (string content, string contentType);
abstract member Content : string * string -> Microsoft.AspNetCore.Mvc.ContentResult
override this.Content : string * string -> Microsoft.AspNetCore.Mvc.ContentResult
Public Overridable Function Content (content As String, contentType As String) As ContentResult

Parameters

content
String

The content to write to the response.

contentType
String

The content type (MIME type).

Returns

The created ContentResult object for the response.

Applies to

Content(String, String, Encoding)

Source:
PageModel.cs
Source:
PageModel.cs
Source:
PageModel.cs

Creates a ContentResult object with Status200OK by specifying a content string, a contentType, and contentEncoding.

public:
 virtual Microsoft::AspNetCore::Mvc::ContentResult ^ Content(System::String ^ content, System::String ^ contentType, System::Text::Encoding ^ contentEncoding);
public virtual Microsoft.AspNetCore.Mvc.ContentResult Content (string content, string contentType, System.Text.Encoding contentEncoding);
abstract member Content : string * string * System.Text.Encoding -> Microsoft.AspNetCore.Mvc.ContentResult
override this.Content : string * string * System.Text.Encoding -> Microsoft.AspNetCore.Mvc.ContentResult
Public Overridable Function Content (content As String, contentType As String, contentEncoding As Encoding) As ContentResult

Parameters

content
String

The content to write to the response.

contentType
String

The content type (MIME type).

contentEncoding
Encoding

The content encoding.

Returns

The created ContentResult object for the response.

Remarks

If encoding is provided by both the 'charset' and the contentEncoding parameters, then the contentEncoding parameter is chosen as the final encoding.

Applies to