共用方式為


Controller.View 方法

定義

多載

View()

建立 ViewResult 物件,將檢視轉譯至回應。

View(Object)

ViewResult 由指定要 model 由檢視轉譯的 來建立 物件。

View(String)

藉由指定 viewName 來建立 ViewResult 物件。

View(String, Object)

ViewResult 由指定 viewNamemodel 要由檢視轉譯的 來建立 物件。

View()

來源:
Controller.cs
來源:
Controller.cs
來源:
Controller.cs

建立 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)

來源:
Controller.cs
來源:
Controller.cs
來源:
Controller.cs

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)

來源:
Controller.cs
來源:
Controller.cs
來源:
Controller.cs

藉由指定 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)

來源:
Controller.cs
來源:
Controller.cs
來源:
Controller.cs

ViewResult 由指定 viewNamemodel 要由檢視轉譯的 來建立 物件。

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 物件。

屬性

適用於