ViewComponent.View 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
View() |
返回一个结果,该结果将呈现名为 |
View(String) |
返回一个结果,该结果将呈现名为 |
View<TModel>(TModel) |
返回一个结果,该结果将呈现名为 |
View<TModel>(String, TModel) |
返回一个结果,该结果将呈现名为 |
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
返回
适用于
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
要呈现的分部视图的名称。
返回
适用于
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
视图的模型对象。
返回
适用于
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
视图的模型对象。