Controller.View Method

Definition

Overloads

View(String, String, Object)

Creates a ViewResult object using the view name, master-page name, and model that renders a view.

View()

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

View(Object)

Creates a ViewResult object by using the model that renders a view to the response.

View(String)

Creates a ViewResult object by using the view name that renders a view.

View(IView)

Creates a ViewResult object that renders the specified IView object.

View(String, Object)

Creates a ViewResult object that renders the specified IView object.

View(String, String)

Creates a ViewResult object using the view name and master-page name that renders a view to the response.

View(IView, Object)

Creates a ViewResult object that renders the specified IView object.

View(String, String, Object)

Creates a ViewResult object using the view name, master-page name, and model that renders a view.

protected internal virtual System.Web.Mvc.ViewResult View (string viewName, string masterName, object model);
abstract member View : string * string * obj -> System.Web.Mvc.ViewResult
override this.View : string * string * obj -> System.Web.Mvc.ViewResult
Protected Friend Overridable Function View (viewName As String, masterName As String, model As Object) As ViewResult

Parameters

viewName
String

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

masterName
String

The name of the master page or template to use when the view is rendered.

model
Object

The model that is rendered by the view.

Returns

The view result.

Applies to

View()

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

protected internal System.Web.Mvc.ViewResult View ();
member this.View : unit -> System.Web.Mvc.ViewResult
Protected Friend Function View () As ViewResult

Returns

The View() result that renders a view to the response.

Applies to

View(Object)

Creates a ViewResult object by using the model that renders a view to the response.

protected internal System.Web.Mvc.ViewResult View (object model);
member this.View : obj -> System.Web.Mvc.ViewResult
Protected Friend Function View (model As Object) As ViewResult

Parameters

model
Object

The model that is rendered by the view.

Returns

The view result.

Applies to

View(String)

Creates a ViewResult object by using the view name that renders a view.

protected internal System.Web.Mvc.ViewResult View (string viewName);
member this.View : string -> System.Web.Mvc.ViewResult
Protected Friend Function View (viewName As String) As ViewResult

Parameters

viewName
String

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

Returns

The view result.

Applies to

View(IView)

Creates a ViewResult object that renders the specified IView object.

protected internal System.Web.Mvc.ViewResult View (System.Web.Mvc.IView view);
member this.View : System.Web.Mvc.IView -> System.Web.Mvc.ViewResult
Protected Friend Function View (view As IView) As ViewResult

Parameters

view
IView

The view that is rendered to the response.

Returns

The view result.

Applies to

View(String, Object)

Creates a ViewResult object that renders the specified IView object.

protected internal System.Web.Mvc.ViewResult View (string viewName, object model);
member this.View : string * obj -> System.Web.Mvc.ViewResult
Protected Friend Function View (viewName As String, model As Object) As ViewResult

Parameters

viewName
String

The view that is rendered to the response.

model
Object

The model that is rendered by the view.

Returns

The view result.

Applies to

View(String, String)

Creates a ViewResult object using the view name and master-page name that renders a view to the response.

protected internal System.Web.Mvc.ViewResult View (string viewName, string masterName);
member this.View : string * string -> System.Web.Mvc.ViewResult
Protected Friend Function View (viewName As String, masterName As String) As ViewResult

Parameters

viewName
String

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

masterName
String

The name of the master page or template to use when the view is rendered.

Returns

The view result.

Applies to

View(IView, Object)

Creates a ViewResult object that renders the specified IView object.

protected internal virtual System.Web.Mvc.ViewResult View (System.Web.Mvc.IView view, object model);
abstract member View : System.Web.Mvc.IView * obj -> System.Web.Mvc.ViewResult
override this.View : System.Web.Mvc.IView * obj -> System.Web.Mvc.ViewResult
Protected Friend Overridable Function View (view As IView, model As Object) As ViewResult

Parameters

view
IView

The view that is rendered to the response.

model
Object

The model that is rendered by the view.

Returns

The view result.

Applies to