【发布时间】:2017-10-07 06:24:46
【问题描述】:
如何将引用 UI 中其他元素(例如文本框值、单选按钮等)的参数传递给被调用以获取自动完成数据的控制器?
例如。从文档中的示例中,当我调用 Home 控制器 GetProducts 操作时,如何随调用一起发送一些参数?
或者更好的是,发布一个 json 对象,其中包含引用来自 ui 中 2-3 个其他小部件的数据的值?
https://docs.telerik.com/aspnet-mvc/helpers/autocomplete/overview#ajax-binding
@(Html.Kendo().AutoComplete()
.Name("productAutoComplete") //The name of the AutoComplete is mandatory. It specifies the "id" attribute of the widget.
.DataTextField("ProductName") //Specify which property of the Product to be used by the AutoComplete.
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetProducts", "Home"); //Set the Action and Controller names.
})
.ServerFiltering(true); //If true, the DataSource will not filter the data on the client.
})
)
【问题讨论】:
-
-Bitshift: - 你有机会调查答案吗?只是想知道,因为您最后一次看到的状态是 1 小时
标签: asp.net-mvc kendo-asp.net-mvc