共用方式為


PageBase.StatusCode 方法

定義

多載

StatusCode(Int32)

藉由指定 statusCode 來建立 StatusCodeResult 物件。

StatusCode(Int32, Object)

藉由指定 statusCode 和 來建立 ObjectResult 物件value

StatusCode(Int32)

來源:
PageBase.cs
來源:
PageBase.cs
來源:
PageBase.cs

藉由指定 statusCode 來建立 StatusCodeResult 物件。

public:
 virtual Microsoft::AspNetCore::Mvc::StatusCodeResult ^ StatusCode(int statusCode);
public virtual Microsoft.AspNetCore.Mvc.StatusCodeResult StatusCode (int statusCode);
abstract member StatusCode : int -> Microsoft.AspNetCore.Mvc.StatusCodeResult
override this.StatusCode : int -> Microsoft.AspNetCore.Mvc.StatusCodeResult
Public Overridable Function StatusCode (statusCode As Integer) As StatusCodeResult

參數

statusCode
Int32

回應上要設定的狀態碼。

傳回

回應的已建立 StatusCodeResult 物件。

適用於

StatusCode(Int32, Object)

來源:
PageBase.cs
來源:
PageBase.cs
來源:
PageBase.cs

藉由指定 statusCode 和 來建立 ObjectResult 物件value

public:
 virtual Microsoft::AspNetCore::Mvc::ObjectResult ^ StatusCode(int statusCode, System::Object ^ value);
public virtual Microsoft.AspNetCore.Mvc.ObjectResult StatusCode (int statusCode, object value);
abstract member StatusCode : int * obj -> Microsoft.AspNetCore.Mvc.ObjectResult
override this.StatusCode : int * obj -> Microsoft.AspNetCore.Mvc.ObjectResult
Public Overridable Function StatusCode (statusCode As Integer, value As Object) As ObjectResult

參數

statusCode
Int32

回應上要設定的狀態碼。

value
Object

要在 ObjectResult 中設定的值。

傳回

回應的已建立 ObjectResult 物件。

適用於