【发布时间】:2014-07-09 01:04:17
【问题描述】:
我对 ASP.NET MVC 还是很陌生(或者至少在更高级的场景中使用它时)——所以我正在寻找针对特定使用场景的反馈以及实现的最佳方法它。我已经尝试过多次搜索,但没有找到类似的东西。
我对实现它的方法非常灵活——只要提议的解决方案运行良好。
假设我有一个名为Vehicle 的实体,它与一个实体VehicleType 相关联,Vehicle 也与一个属性实体相关联,该实体基于VehicleType 称为VehicleProperties。例如 - 车辆类型可以是“Car”、“Boat”等,VehicleProperties 包含 Car VehicleType 的“BodyStyle”、“Color”等,以及“Boat”VehicleType 的“Length”、“Weight”等
On the create and edit forms for the VehicleConntroller I'm looking to do something along these lines: Have a drop down list of vehicle types and when the selection of that changes load the appropriate "VehicleProperties" form that is specific到这个 VehicleType。
这就是我的问题所在 - MVC 中最好的方法是什么?寻找 AJAX 类型的方法。如果有人有任何可以概述潜在解决方案的示例教程或文章 - 我将不胜感激!
我目前正在使用带有 jQuery 的 ASP.NET MVC 5 - 但如果需要一个优雅的解决方案,我愿意添加其他 JS 库。
【问题讨论】:
标签: asp.net-mvc asp.net-mvc-ajax