ContentResult 類別

定義

ActionResult 執行時會產生具有內容的回應。

public ref class ContentResult : Microsoft::AspNetCore::Mvc::ActionResult
public ref class ContentResult : Microsoft::AspNetCore::Mvc::ActionResult, Microsoft::AspNetCore::Mvc::IActionResult, Microsoft::AspNetCore::Mvc::Infrastructure::IStatusCodeActionResult
public class ContentResult : Microsoft.AspNetCore.Mvc.ActionResult
public class ContentResult : Microsoft.AspNetCore.Mvc.ActionResult, Microsoft.AspNetCore.Mvc.IActionResult, Microsoft.AspNetCore.Mvc.Infrastructure.IStatusCodeActionResult
type ContentResult = class
    inherit ActionResult
type ContentResult = class
    inherit ActionResult
    interface IStatusCodeActionResult
    interface IActionResult
type ContentResult = class
    inherit ActionResult
    interface IActionResult
    interface IStatusCodeActionResult
Public Class ContentResult
Inherits ActionResult
Public Class ContentResult
Inherits ActionResult
Implements IActionResult, IStatusCodeActionResult
繼承
ContentResult
實作

建構函式

ContentResult()

ActionResult 執行時會產生具有內容的回應。

屬性

Content

取得或設定代表回應主體的內容。

ContentType

取得或設定回應的 Content-Type 標頭,這個標頭可以使用 來處理 MediaTypeHeaderValue

StatusCode

取得或設定 HTTP 狀態碼

方法

ExecuteResult(ActionContext)

同步執行動作方法的結果作業。 MVC 會呼叫這個方法來處理動作方法的結果。

(繼承來源 ActionResult)
ExecuteResultAsync(ActionContext)

以非同步方式執行動作方法的結果作業。 MVC 會呼叫這個方法來處理動作方法的結果。

適用於