PageModel.ViewComponent 方法

定义

重载

ViewComponent(Type, Object)

ViewComponentResult通过指定要Type呈现的视图组件的 创建 。

ViewComponent(String)

ViewComponentResult通过指定要呈现的视图组件的名称来创建 。

ViewComponent(Type)

ViewComponentResult通过指定要Type呈现的视图组件的 创建 。

ViewComponent(String, Object)

ViewComponentResult通过指定要呈现的视图组件的名称来创建 。

ViewComponent(Type, Object)

ViewComponentResult通过指定要Type呈现的视图组件的 创建 。

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

参数

componentType
Type

视图组件 Type

arguments
Object

一个 , Object 其属性表示要传递给调用的视图组件方法的参数。 或者,一个 IDictionary<TKey,TValue> 包含调用参数的 实例。

返回

为响应创建的 ViewComponentResult 对象。

适用于

ViewComponent(String)

ViewComponentResult通过指定要呈现的视图组件的名称来创建 。

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

参数

componentName
String

视图组件名称。 可以是视图组件 ShortNameFullName

返回

为响应创建的 ViewComponentResult 对象。

适用于

ViewComponent(Type)

ViewComponentResult通过指定要Type呈现的视图组件的 创建 。

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

参数

componentType
Type

视图组件 Type

返回

为响应创建的 ViewComponentResult 对象。

适用于

ViewComponent(String, Object)

ViewComponentResult通过指定要呈现的视图组件的名称来创建 。

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

参数

componentName
String

视图组件名称。 可以是视图组件 ShortNameFullName

arguments
Object

一个 , Object 其属性表示要传递给调用的视图组件方法的参数。 或者,一个 IDictionary<TKey,TValue> 包含调用参数的 实例。

返回

为响应创建的 ViewComponentResult 对象。

适用于