PageModel.ViewComponent 方法   
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| ViewComponent(Type, Object) | ViewComponentResult通过指定要Type呈现的视图组件的 创建 。 | 
| ViewComponent(String) | ViewComponentResult通过指定要呈现的视图组件的名称来创建 。 | 
| ViewComponent(Type) | ViewComponentResult通过指定要Type呈现的视图组件的 创建 。 | 
| ViewComponent(String, Object) | ViewComponentResult通过指定要呈现的视图组件的名称来创建 。 | 
ViewComponent(Type, Object)
- Source:
- PageModel.cs
- Source:
- PageModel.cs
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.ViewComponentResultPublic Overridable Function ViewComponent (componentType As Type, arguments As Object) As ViewComponentResult参数
- arguments
- Object
一个 , Object 其属性表示要传递给调用的视图组件方法的参数。 或者,一个 IDictionary<TKey,TValue> 包含调用参数的 实例。
返回
为响应创建的 ViewComponentResult 对象。
适用于
ViewComponent(String)
- Source:
- PageModel.cs
- Source:
- PageModel.cs
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.ViewComponentResultPublic Overridable Function ViewComponent (componentName As String) As ViewComponentResult参数
返回
为响应创建的 ViewComponentResult 对象。
适用于
ViewComponent(Type)
- Source:
- PageModel.cs
- Source:
- PageModel.cs
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.ViewComponentResultPublic Overridable Function ViewComponent (componentType As Type) As ViewComponentResult参数
返回
为响应创建的 ViewComponentResult 对象。
适用于
ViewComponent(String, Object)
- Source:
- PageModel.cs
- Source:
- PageModel.cs
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.ViewComponentResultPublic Overridable Function ViewComponent (componentName As String, arguments As Object) As ViewComponentResult参数
- arguments
- Object
一个 , Object 其属性表示要传递给调用的视图组件方法的参数。 或者,一个 IDictionary<TKey,TValue> 包含调用参数的 实例。
返回
为响应创建的 ViewComponentResult 对象。