ViewComponent.View 方法

定义

重载

View()

返回一个结果,该结果将呈现名为 "Default"的分部视图。

View(String)

返回一个结果,该结果将呈现名为 viewName的分部视图。

View<TModel>(TModel)

返回一个结果,该结果将呈现名为 "Default"的分部视图。

View<TModel>(String, TModel)

返回一个结果,该结果将呈现名为 viewName的分部视图。

View()

Source:
ViewComponent.cs
Source:
ViewComponent.cs
Source:
ViewComponent.cs

返回一个结果,该结果将呈现名为 "Default"的分部视图。

public:
 Microsoft::AspNetCore::Mvc::ViewComponents::ViewViewComponentResult ^ View();
public Microsoft.AspNetCore.Mvc.ViewComponents.ViewViewComponentResult View ();
member this.View : unit -> Microsoft.AspNetCore.Mvc.ViewComponents.ViewViewComponentResult
Public Function View () As ViewViewComponentResult

返回

一个 ViewViewComponentResult

适用于

View(String)

Source:
ViewComponent.cs
Source:
ViewComponent.cs
Source:
ViewComponent.cs

返回一个结果,该结果将呈现名为 viewName的分部视图。

public:
 Microsoft::AspNetCore::Mvc::ViewComponents::ViewViewComponentResult ^ View(System::String ^ viewName);
public Microsoft.AspNetCore.Mvc.ViewComponents.ViewViewComponentResult View (string viewName);
public Microsoft.AspNetCore.Mvc.ViewComponents.ViewViewComponentResult View (string? viewName);
member this.View : string -> Microsoft.AspNetCore.Mvc.ViewComponents.ViewViewComponentResult
Public Function View (viewName As String) As ViewViewComponentResult

参数

viewName
String

要呈现的分部视图的名称。

返回

一个 ViewViewComponentResult

适用于

View<TModel>(TModel)

Source:
ViewComponent.cs
Source:
ViewComponent.cs
Source:
ViewComponent.cs

返回一个结果,该结果将呈现名为 "Default"的分部视图。

public:
generic <typename TModel>
 Microsoft::AspNetCore::Mvc::ViewComponents::ViewViewComponentResult ^ View(TModel model);
public Microsoft.AspNetCore.Mvc.ViewComponents.ViewViewComponentResult View<TModel> (TModel model);
public Microsoft.AspNetCore.Mvc.ViewComponents.ViewViewComponentResult View<TModel> (TModel? model);
member this.View : 'Model -> Microsoft.AspNetCore.Mvc.ViewComponents.ViewViewComponentResult
Public Function View(Of TModel) (model As TModel) As ViewViewComponentResult

类型参数

TModel

参数

model
TModel

视图的模型对象。

返回

一个 ViewViewComponentResult

适用于

View<TModel>(String, TModel)

Source:
ViewComponent.cs
Source:
ViewComponent.cs
Source:
ViewComponent.cs

返回一个结果,该结果将呈现名为 viewName的分部视图。

public:
generic <typename TModel>
 Microsoft::AspNetCore::Mvc::ViewComponents::ViewViewComponentResult ^ View(System::String ^ viewName, TModel model);
public Microsoft.AspNetCore.Mvc.ViewComponents.ViewViewComponentResult View<TModel> (string viewName, TModel model);
public Microsoft.AspNetCore.Mvc.ViewComponents.ViewViewComponentResult View<TModel> (string? viewName, TModel? model);
member this.View : string * 'Model -> Microsoft.AspNetCore.Mvc.ViewComponents.ViewViewComponentResult
Public Function View(Of TModel) (viewName As String, model As TModel) As ViewViewComponentResult

类型参数

TModel

参数

viewName
String

要呈现的分部视图的名称。

model
TModel

视图的模型对象。

返回

一个 ViewViewComponentResult

适用于