ViewComponent.View Method  
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| View() | 
						 Returns a result which will render the partial view with name   | 
        	
| View(String) | 
						 Returns a result which will render the partial view with name   | 
        	
| View<TModel>(TModel) | 
						 Returns a result which will render the partial view with name   | 
        	
| View<TModel>(String, TModel) | 
						 Returns a result which will render the partial view with name   | 
        	
View()
- Source:
 - ViewComponent.cs
 
- Source:
 - ViewComponent.cs
 
- Source:
 - ViewComponent.cs
 
Returns a result which will render the partial view with name "Default".
public:
 Microsoft::AspNetCore::Mvc::ViewComponents::ViewViewComponentResult ^ View();
	public Microsoft.AspNetCore.Mvc.ViewComponents.ViewViewComponentResult View();
	member this.View : unit -> Microsoft.AspNetCore.Mvc.ViewComponents.ViewViewComponentResult
	Public Function View () As ViewViewComponentResult
	Returns
Applies to
View(String)
- Source:
 - ViewComponent.cs
 
- Source:
 - ViewComponent.cs
 
- Source:
 - ViewComponent.cs
 
Returns a result which will render the partial view with name viewName.
public:
 Microsoft::AspNetCore::Mvc::ViewComponents::ViewViewComponentResult ^ View(System::String ^ viewName);
	public Microsoft.AspNetCore.Mvc.ViewComponents.ViewViewComponentResult View(string viewName);
	public Microsoft.AspNetCore.Mvc.ViewComponents.ViewViewComponentResult View(string? viewName);
	member this.View : string -> Microsoft.AspNetCore.Mvc.ViewComponents.ViewViewComponentResult
	Public Function View (viewName As String) As ViewViewComponentResult
	Parameters
- viewName
 - String
 
The name of the partial view to render.
Returns
Applies to
View<TModel>(TModel)
- Source:
 - ViewComponent.cs
 
- Source:
 - ViewComponent.cs
 
- Source:
 - ViewComponent.cs
 
Returns a result which will render the partial view with name "Default".
public:
generic <typename TModel>
 Microsoft::AspNetCore::Mvc::ViewComponents::ViewViewComponentResult ^ View(TModel model);
	public Microsoft.AspNetCore.Mvc.ViewComponents.ViewViewComponentResult View<TModel>(TModel model);
	public Microsoft.AspNetCore.Mvc.ViewComponents.ViewViewComponentResult View<TModel>(TModel? model);
	member this.View : 'Model -> Microsoft.AspNetCore.Mvc.ViewComponents.ViewViewComponentResult
	Public Function View(Of TModel) (model As TModel) As ViewViewComponentResult
    Type Parameters
- TModel
 
Parameters
- model
 - TModel
 
The model object for the view.
Returns
Applies to
View<TModel>(String, TModel)
- Source:
 - ViewComponent.cs
 
- Source:
 - ViewComponent.cs
 
- Source:
 - ViewComponent.cs
 
Returns a result which will render the partial view with name viewName.
public:
generic <typename TModel>
 Microsoft::AspNetCore::Mvc::ViewComponents::ViewViewComponentResult ^ View(System::String ^ viewName, TModel model);
	public Microsoft.AspNetCore.Mvc.ViewComponents.ViewViewComponentResult View<TModel>(string viewName, TModel model);
	public Microsoft.AspNetCore.Mvc.ViewComponents.ViewViewComponentResult View<TModel>(string? viewName, TModel? model);
	member this.View : string * 'Model -> Microsoft.AspNetCore.Mvc.ViewComponents.ViewViewComponentResult
	Public Function View(Of TModel) (viewName As String, model As TModel) As ViewViewComponentResult
    Type Parameters
- TModel
 
Parameters
- viewName
 - String
 
The name of the partial view to render.
- model
 - TModel
 
The model object for the view.