Jquery 如何在客户端为Telerik combobox设置路由值

Jquery 如何在客户端为Telerik combobox设置路由值,jquery,asp.net-mvc-3,telerik,telerik-mvc,telerik-combobox,Jquery,Asp.net Mvc 3,Telerik,Telerik Mvc,Telerik Combobox,我有两个组合框。我需要在combobox1更改值后从第一个Combox1获取一些值,并将该值放入Combox2路由中 databinding.Ajax.Selectaction,controller,->route您可以从当前RoutedData获取它: new { curentCountry = ViewContext.RouteData.Values["countryID"] } 其中countryID是您正在使用的路由参数的名称。或者,如果它是查询字符串的一部分而不是路由的一部分: ne

我有两个组合框。我需要在combobox1更改值后从第一个Combox1获取一些值,并将该值放入Combox2路由中

databinding.Ajax.Selectaction,controller,->route您可以从当前RoutedData获取它:

new { curentCountry = ViewContext.RouteData.Values["countryID"] }
其中countryID是您正在使用的路由参数的名称。或者,如果它是查询字符串的一部分而不是路由的一部分:

new { curentCountry = Request["countryID"] }
您可以查看,其中说明了如何订阅OnDataBinding事件,该事件在请求获取数据时引发:

因此,您可以订阅OnDataBinding事件:

它允许您向该请求传递其他参数

<script type="text/javascript">
    function onComboBoxDataBinding(e) {
        e.data = $.extend({ }, e.data, { curentCountry: "customValue"});
    }
</script>

这是客户端。。。当combobox1更改时,combobox2不知道选择了什么值。据我所知,我不能把它放在常规中。。我需要使用客户端事件onBind,并在此函数中创建ajaxrequest@Sasha哦,对不起,我误解了你的要求。我已经更新了我的答案。
@(Html.Telerik()
      .ComboBoxFor(m => m.UnitOfAdministration)
      .ClientEvents(e => e.OnDataBinding("onComboBoxDataBinding"))
      .BindTo(Model.ListUnitOfAdministration)
      .DataBinding(bind => bind.Ajax().Select("GetCityListByStr", "User")
      .Delay(1000)
)
<script type="text/javascript">
    function onComboBoxDataBinding(e) {
        e.data = $.extend({ }, e.data, { curentCountry: "customValue"});
    }
</script>