简体   繁体   English

.Net Core MVC中的可重用级联下拉列表

[英]Reusable Cascading DropDown List in .Net Core MVC

I have a cascading drop-down list which is used in most of my views. 我有一个级联的下拉列表,大多数视图都使用该列表。

Are there other methods except for creating a partial view in .Net Core with MVC with which I can reuse them in all my views? 除了使用MVC在.Net Core中创建局部视图之外,还有其他方法可用来在所有视图中重用它们吗?

TIA. TIA。

In asp.net core , you can use View components . 在asp.net核心中,您可以使用View组件

View components are similar to partial views, but they're much more powerful ,it can inlcudes business logic ,the same separation-of-concerns and testability benefits found between a controller and view , and are intended anywhere you have reusable rendering logic that's too complex for a partial view . 视图组件类似于部分视图,但是它们的功能要强大得多,它可以包含业务逻辑,在控制器和视图之间发现的相同的关注点分离和可测试性优点,并且适用于您拥有可重用的渲染逻辑的任何地方部分观点复杂。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM