Share via


ViewComponent.View Method

Definition

Overloads

View()

Returns a result which will render the partial view with name "Default".

View(String)

Returns a result which will render the partial view with name viewName.

View<TModel>(TModel)

Returns a result which will render the partial view with name "Default".

View<TModel>(String, TModel)

Returns a result which will render the partial view with name viewName.

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

A ViewViewComponentResult.

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

A ViewViewComponentResult.

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

A ViewViewComponentResult.

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.

Returns

A ViewViewComponentResult.

Applies to