互相引用的Asp.Net 2项进入无限循环

时间:2015-12-09 11:13:35

标签: asp.net asp.net-mvc asp.net-mvc-4 cascadingdropdown

我正在尝试将2个CascadeDropDownFor引用到彼此,因为它们的值相互依赖。当一个人完成加载时,另一个人再次启动并继续循环:

@Form.Fields(Html.LabelFor(x => x.Item.FirstBusLineRouteStopId),
Html.CascadeDropDownFor(x => x.Item.FirstBusLineRouteStopId)
    .With<TicketSalesController>(x => x.FirstBusLineRouteStops(null,null))
    .Reference(x => x.Item.BusLineTemplateId,"id")
    .Reference(x => x.Item.LastBusLineRouteStopId, "lastId")
    .Items(Model.FirstBusLineRouteStops)
    .WithEmptySelection().Large())
@Form.Fields(Html.LabelFor(x => x.Item.LastBusLineRouteStopId),
Html.CascadeDropDownFor(x => x.Item.LastBusLineRouteStopId)
    .With<TicketSalesController>(x => x.LastBusLineRouteStops(null,null))
    .Reference(x => x.Item.BusLineTemplateId,"id")
    .Reference(x => x.Item.FirstBusLineRouteStopId, "firstId")
    .Items(Model.LastBusLineRouteStops)
    .WithEmptySelection().Large())

我应该以哪种方式执行此操作?

0 个答案:

没有答案