Controller.View 方法

定义

重载

View()

创建一个 ViewResult 对象,该对象将视图呈现给响应。

View(Object)

ViewResult通过指定要model由视图呈现的 来创建 对象。

View(String)

ViewResult通过指定 viewName创建 对象。

View(String, Object)

ViewResult通过指定要viewName由视图呈现的 和 model 来创建 对象。

View()

Source:
Controller.cs
Source:
Controller.cs
Source:
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)

Source:
Controller.cs
Source:
Controller.cs
Source:
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)

Source:
Controller.cs
Source:
Controller.cs
Source:
Controller.cs

ViewResult通过指定 viewName创建 对象。

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)

Source:
Controller.cs
Source:
Controller.cs
Source:
Controller.cs

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 对象。

属性

适用于