Share via


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.

public:
 virtual Microsoft::AspNetCore::Mvc::ViewComponentResult ^ ViewComponent(Type ^ componentType, System::Object ^ arguments);
public virtual Microsoft.AspNetCore.Mvc.ViewComponentResult ViewComponent (Type componentType, object arguments);
public virtual Microsoft.AspNetCore.Mvc.ViewComponentResult ViewComponent (Type componentType, object? arguments);
abstract member ViewComponent : Type * obj -> Microsoft.AspNetCore.Mvc.ViewComponentResult
override this.ViewComponent : Type * obj -> Microsoft.AspNetCore.Mvc.ViewComponentResult
Public Overridable Function ViewComponent (componentType As Type, arguments As Object) As ViewComponentResult

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

ViewComponent(String)

Source:
PageModel.cs
Source:
PageModel.cs

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

public:
 virtual Microsoft::AspNetCore::Mvc::ViewComponentResult ^ ViewComponent(System::String ^ componentName);
public virtual Microsoft.AspNetCore.Mvc.ViewComponentResult ViewComponent (string componentName);
abstract member ViewComponent : string -> Microsoft.AspNetCore.Mvc.ViewComponentResult
override this.ViewComponent : string -> Microsoft.AspNetCore.Mvc.ViewComponentResult
Public Overridable Function ViewComponent (componentName As String) As ViewComponentResult

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

ViewComponent(Type)

Source:
PageModel.cs
Source:
PageModel.cs

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

public:
 virtual Microsoft::AspNetCore::Mvc::ViewComponentResult ^ ViewComponent(Type ^ componentType);
public virtual Microsoft.AspNetCore.Mvc.ViewComponentResult ViewComponent (Type componentType);
abstract member ViewComponent : Type -> Microsoft.AspNetCore.Mvc.ViewComponentResult
override this.ViewComponent : Type -> Microsoft.AspNetCore.Mvc.ViewComponentResult
Public Overridable Function ViewComponent (componentType As Type) As ViewComponentResult

Parameters

componentType
Type

The view component Type.

Returns

The created ViewComponentResult object for the response.

Applies to

ViewComponent(String, Object)

Source:
PageModel.cs
Source:
PageModel.cs

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

public:
 virtual Microsoft::AspNetCore::Mvc::ViewComponentResult ^ ViewComponent(System::String ^ componentName, System::Object ^ arguments);
public virtual Microsoft.AspNetCore.Mvc.ViewComponentResult ViewComponent (string componentName, object arguments);
public virtual Microsoft.AspNetCore.Mvc.ViewComponentResult ViewComponent (string componentName, object? arguments);
abstract member ViewComponent : string * obj -> Microsoft.AspNetCore.Mvc.ViewComponentResult
override this.ViewComponent : string * obj -> Microsoft.AspNetCore.Mvc.ViewComponentResult
Public Overridable Function ViewComponent (componentName As String, arguments As Object) As ViewComponentResult

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