Controller.View 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
View() |
建立 ViewResult 物件,將檢視轉譯至回應。 |
View(Object) |
藉 ViewResult 由指定要 |
View(String) |
藉由指定 |
View(String, Object) |
藉 ViewResult 由指定 |
View()
建立 ViewResult 物件,將檢視轉譯至回應。
public:
virtual Microsoft::AspNetCore::Mvc::ViewResult ^ View();
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ViewResult View ();
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member View : unit -> Microsoft.AspNetCore.Mvc.ViewResult
override this.View : unit -> Microsoft.AspNetCore.Mvc.ViewResult
Public Overridable Function View () As ViewResult
傳回
回應的已建立 ViewResult 物件。
- 屬性
適用於
View(Object)
藉 ViewResult 由指定要 model
由檢視轉譯的 來建立 物件。
public:
virtual Microsoft::AspNetCore::Mvc::ViewResult ^ View(System::Object ^ model);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ViewResult View (object model);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ViewResult View (object? model);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member View : obj -> Microsoft.AspNetCore.Mvc.ViewResult
override this.View : obj -> Microsoft.AspNetCore.Mvc.ViewResult
Public Overridable Function View (model As Object) As ViewResult
參數
- model
- Object
由檢視呈現的模型。
傳回
回應的已建立 ViewResult 物件。
- 屬性
適用於
View(String)
藉由指定 viewName
來建立 ViewResult 物件。
public:
virtual Microsoft::AspNetCore::Mvc::ViewResult ^ View(System::String ^ viewName);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ViewResult View (string viewName);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ViewResult View (string? viewName);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member View : string -> Microsoft.AspNetCore.Mvc.ViewResult
override this.View : string -> Microsoft.AspNetCore.Mvc.ViewResult
Public Overridable Function View (viewName As String) As ViewResult
參數
- viewName
- String
呈現至回應之檢視的名稱或路徑。
傳回
回應的已建立 ViewResult 物件。
- 屬性
適用於
View(String, Object)
藉 ViewResult 由指定 viewName
和 model
要由檢視轉譯的 來建立 物件。
public:
virtual Microsoft::AspNetCore::Mvc::ViewResult ^ View(System::String ^ viewName, System::Object ^ model);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ViewResult View (string viewName, object model);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ViewResult View (string? viewName, object? model);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member View : string * obj -> Microsoft.AspNetCore.Mvc.ViewResult
override this.View : string * obj -> Microsoft.AspNetCore.Mvc.ViewResult
Public Overridable Function View (viewName As String, model As Object) As ViewResult
參數
- viewName
- String
呈現至回應之檢視的名稱或路徑。
- model
- Object
由檢視呈現的模型。
傳回
回應的已建立 ViewResult 物件。
- 屬性