PageModel.ViewComponent Method

Definition

Overloads

ViewComponent(Type, Object)

Creates a ViewComponentResult by specifying the Type of a view component to render.

ViewComponent(String)

Creates a ViewComponentResult by specifying the name of a view component to render.

ViewComponent(Type)

Creates a ViewComponentResult by specifying the Type of a view component to render.

ViewComponent(String, Object)

Creates a ViewComponentResult by specifying the name of a view component to render.

ViewComponent(Type, Object)

Source:
PageModel.cs
Source:
PageModel.cs

Creates a ViewComponentResult by specifying the Type of a view component to render.

C#
public virtual Microsoft.AspNetCore.Mvc.ViewComponentResult ViewComponent (Type componentType, object arguments);
C#
public virtual Microsoft.AspNetCore.Mvc.ViewComponentResult ViewComponent (Type componentType, object? arguments);

Parameters

componentType
Type

The view component Type.

arguments
Object

An Object with properties representing arguments to be passed to the invoked view component method. Alternatively, an IDictionary<TKey,TValue> instance containing the invocation arguments.

Returns

The created ViewComponentResult object for the response.

Applies to

ASP.NET Core 9.0 a ďalšie verzie
Produkt Verzie
ASP.NET Core 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

ViewComponent(String)

Source:
PageModel.cs
Source:
PageModel.cs

Creates a ViewComponentResult by specifying the name of a view component to render.

C#
public virtual Microsoft.AspNetCore.Mvc.ViewComponentResult ViewComponent (string componentName);

Parameters

componentName
String

The view component name. Can be a view component ShortName or FullName.

Returns

The created ViewComponentResult object for the response.

Applies to

ASP.NET Core 9.0 a ďalšie verzie
Produkt Verzie
ASP.NET Core 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

ViewComponent(Type)

Source:
PageModel.cs
Source:
PageModel.cs

Creates a ViewComponentResult by specifying the Type of a view component to render.

C#
public virtual Microsoft.AspNetCore.Mvc.ViewComponentResult ViewComponent (Type componentType);

Parameters

componentType
Type

The view component Type.

Returns

The created ViewComponentResult object for the response.

Applies to

ASP.NET Core 9.0 a ďalšie verzie
Produkt Verzie
ASP.NET Core 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

ViewComponent(String, Object)

Source:
PageModel.cs
Source:
PageModel.cs

Creates a ViewComponentResult by specifying the name of a view component to render.

C#
public virtual Microsoft.AspNetCore.Mvc.ViewComponentResult ViewComponent (string componentName, object arguments);
C#
public virtual Microsoft.AspNetCore.Mvc.ViewComponentResult ViewComponent (string componentName, object? arguments);

Parameters

componentName
String

The view component name. Can be a view component ShortName or FullName.

arguments
Object

An Object with properties representing arguments to be passed to the invoked view component method. Alternatively, an IDictionary<TKey,TValue> instance containing the invocation arguments.

Returns

The created ViewComponentResult object for the response.

Applies to

ASP.NET Core 9.0 a ďalšie verzie
Produkt Verzie
ASP.NET Core 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0