Controller..::.View Method
This page is specific to:.NET Framework Version:3.54.0
.NET Framework Class Library
Controller..::.View Method

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

Overload List

  NameDescription
Protected method View()()() Creates a ViewResult object that renders a view to the response.
Protected method View(Object) Creates a ViewResult object using the model that renders a view to the response.
Protected method View(String) Creates a ViewResult object using the view name that renders a view.
Protected method View(IView) Creates a ViewResult object that renders the specified IView object.
Protected method View(String, Object) Creates a ViewResult object using the view name and model that renders a view to the response.
Protected method View(String, String) Creates a ViewResult object using the view name and master page name that renders a view to the response.
Protected method View(IView, Object) Creates a ViewResult object that renders the specified IView object.
Protected method View(String, String, Object) Creates a ViewResult object using the view name, master page name and model that renders a view.
Top
Remarks

The View()()() and View(Object) method overloads return a ViewResult object with an empty ViewName property. If you are writing unit tests for controller actions, take into account the empty ViewName property for unit tests that do not take a string view name or a parameter of type IView.

At run time, if the ViewName property is empty, the current action name is used in place of the ViewName property.

See Also

Reference

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View