Dela via


Controller.View Method

Definition

Overloads

View()

Creates a ViewResult object that renders a view to the response.

View(Object)

Creates a ViewResult object by specifying a model to be rendered by the view.

View(String)

Creates a ViewResult object by specifying a viewName.

View(String, Object)

Creates a ViewResult object by specifying a viewName and the model to be rendered by the view.

View()

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

Creates a ViewResult object that renders a view to the response.

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

Returns

The created ViewResult object for the response.

Attributes

Applies to

View(Object)

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

Creates a ViewResult object by specifying a model to be rendered by the view.

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

Parameters

model
Object

The model that is rendered by the view.

Returns

The created ViewResult object for the response.

Attributes

Applies to

View(String)

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

Creates a ViewResult object by specifying a 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

Parameters

viewName
String

The name or path of the view that is rendered to the response.

Returns

The created ViewResult object for the response.

Attributes

Applies to

View(String, Object)

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

Creates a ViewResult object by specifying a viewName and the model to be rendered by the view.

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

Parameters

viewName
String

The name or path of the view that is rendered to the response.

model
Object

The model that is rendered by the view.

Returns

The created ViewResult object for the response.

Attributes

Applies to