Controller.View Controller.View Controller.View Method

Definition

Overloads

View() View() View()

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

View(Object) View(Object) View(Object)

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

View(String) View(String) View(String)

Creates a ViewResult object by specifying a viewName.

View(String, Object) View(String, Object) View(String, Object)

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

View() View() View()

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

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ViewResult View ();
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.

View(Object) View(Object) View(Object)

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

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ViewResult View (object model);
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 Object Object

The model that is rendered by the view.

Returns

The created ViewResult object for the response.

View(String) View(String) View(String)

Creates a ViewResult object by specifying a viewName.

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ViewResult View (string viewName);
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 String String

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

Returns

The created ViewResult object for the response.

View(String, Object) View(String, Object) View(String, Object)

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

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ViewResult View (string viewName, object model);
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 String String

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

model
Object Object Object

The model that is rendered by the view.

Returns

The created ViewResult object for the response.

Applies to