cshtml页面:
1 <wt:combobox field="Entity.ServicenameCodeID" items="AllServicenameCodes" link-field="@Model.AllshippingmethodsID" trigger-url="/ChannelApiInfor/GetServicenameIDByshippingmethod" /> 2 <wt:combobox field="@Model.AllshippingmethodsID" items="Allshippingmethods" multi-select="true" />
控制器方法:
1 [ActionDescription("级联")] 2 public IActionResult GetServicenameIDByshippingmethod(Guid id) 3 { 4 var vm= DC.Set<ShippingMethod>().Where(c => c.ServicenameCodeID == id).Select(m=> new { Text=m.cnname,Value=m.ID}).ToList(); 5 6 return Json(vm); 7 }
另外可以参照一下图片: