【发布时间】:2016-08-24 07:51:14
【问题描述】:
@(Html.Kendo().DropDownListFor(model => model.ServiceID)
.OptionLabelTemplate("#=optionLabel#")
.ValueTemplate("#=Code#(#=Rate#) - #=Description#")
.Template("#=Code#(#=Rate#) - #=Description#")
.DataTextField("Code")
.DataValueField("ServiceID")
.DataSource(d =>
{
d.Read(read =>
{
read.Action("GetServiceRepository", "Service").Data("...")
.Type(HttpVerbs.Post);
});
})
.OptionLabel(new { optionLabel = Resources.Wording.SelectOne, ServiceID = 0, Rate = 0, Code = "" })
)
我有一个 Kendo Dropdownlist,它使用 HTML 辅助方式而不是 JQuery 方式初始化。
是否可以使用 JSON 作为 contentType 而不是默认的 application/x-www-form-urlencoded 向 /Service/GetServiceRepository 发出发布请求?
【问题讨论】:
-
请提供一些关于您的 polemm 和您正在使用的数据的详细信息。
-
我从来不需要显式设置
contentType,而且我总是使用 JSON。你确定这不是你的服务端的东西吗?
标签: javascript jquery json asp.net-mvc kendo-asp.net-mvc