Share via


Controller.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:
Controller.cs
Source:
Controller.cs
Source:
Controller.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);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ViewComponentResult ViewComponent (Type componentType, object arguments);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ViewComponentResult ViewComponent (Type componentType, object? arguments);
[<Microsoft.AspNetCore.Mvc.NonAction>]
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.

Attributes

Applies to

ViewComponent(String)

Source:
Controller.cs
Source:
Controller.cs
Source:
Controller.cs

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

public:
 virtual Microsoft::AspNetCore::Mvc::ViewComponentResult ^ ViewComponent(System::String ^ componentName);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ViewComponentResult ViewComponent (string componentName);
[<Microsoft.AspNetCore.Mvc.NonAction>]
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.

Attributes

Applies to

ViewComponent(Type)

Source:
Controller.cs
Source:
Controller.cs
Source:
Controller.cs

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

public:
 virtual Microsoft::AspNetCore::Mvc::ViewComponentResult ^ ViewComponent(Type ^ componentType);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ViewComponentResult ViewComponent (Type componentType);
[<Microsoft.AspNetCore.Mvc.NonAction>]
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.

Attributes

Applies to

ViewComponent(String, Object)

Source:
Controller.cs
Source:
Controller.cs
Source:
Controller.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);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ViewComponentResult ViewComponent (string componentName, object arguments);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ViewComponentResult ViewComponent (string componentName, object? arguments);
[<Microsoft.AspNetCore.Mvc.NonAction>]
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.

Attributes

Applies to