Controller::View Method
Creates a ViewResult object that renders a view to the response.
Assembly: System.Web.Mvc (in System.Web.Mvc.dll)
| Name | Description | |
|---|---|---|
![]() | View() | Creates a ViewResult object that renders a view to the response. |
![]() | View(IView^) | Creates a ViewResult object that renders the specified IView object. |
![]() | View(IView^, Object^) | Creates a ViewResult object that renders the specified IView object. |
![]() | 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(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(String^, String^, Object^) | Creates a ViewResult object using the view name, master-page name, and model that renders a view. |
Controller::View Method ()
Creates a ViewResult object that renders a view to the response.
This method overload of the View class returns a ViewResult object that has 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.
At run time, if the ViewName property is empty, the current action name is used in place of the ViewName property.
Controller::View Method (IView^)
Creates a ViewResult object that renders the specified IView object.
Parameters
- view
-
Type:
System.Web.Mvc::IView^
The view that is rendered to the response.
The result object that is prepared by this method is written to the response by the ASP.NET MVC framework when the object is executed.
Controller::View Method (IView^, Object^)
Creates a ViewResult object that renders the specified IView object.
Parameters
- view
-
Type:
System.Web.Mvc::IView^
The view that is rendered to the response.
- model
-
Type:
System::Object^
The model that is rendered by the view.
The result object that is prepared by this method is written to the response by the ASP.NET MVC framework when the object is executed.
Controller::View Method (Object^)
Creates a ViewResult object by using the model that renders a view to the response.
Parameters
- model
-
Type:
System::Object^
The model that is rendered by the view.
This overload of the View method returns a ViewResult object that has an empty ViewName property. If you are writing unit tests for controller actions, take into account the empty ViewNameproperty for unit tests that do not take a string view name.
Controller::View Method (String^)
Creates a ViewResult object by using the view name that renders a view.
Parameters
- viewName
-
Type:
System::String^
The name of the view that is rendered to the response.
The result object that is prepared by this method is written to the response by the ASP.NET MVC framework when the object is executed.
Controller::View Method (String^, Object^)
Creates a ViewResult object that renders the specified IView object.
Parameters
- viewName
-
Type:
System::String^
The view that is rendered to the response.
- model
-
Type:
System::Object^
The model that is rendered by the view.
The result object that is prepared by this method is written to the response by the ASP.NET MVC framework when the object is executed.
Controller::View Method (String^, String^)
Creates a ViewResult object using the view name and master-page name that renders a view to the response.
Parameters
- viewName
-
Type:
System::String^
The name of the view that is rendered to the response.
- masterName
-
Type:
System::String^
The name of the master page or template to use when the view is rendered.
The result object that is prepared by this method is written to the response by the ASP.NET MVC framework when the object is executed.
Controller::View Method (String^, String^, Object^)
Creates a ViewResult object using the view name, master-page name, and model that renders a view.
public protected: virtual ViewResult^ View( String^ viewName, String^ masterName, Object^ model )
Parameters
- viewName
-
Type:
System::String^
The name of the view that is rendered to the response.
- masterName
-
Type:
System::String^
The name of the master page or template to use when the view is rendered.
- model
-
Type:
System::Object^
The model that is rendered by the view.
The result object that is prepared by this method is written to the response by the ASP.NET MVC framework when the object is executed.
