0
我需要將contentType作爲「application/json」發送到webApi控制器。下面是我使用的代碼,它不工作。將內容類型從kenod下拉列表發送到webapi
@(Html.Kendo().DropDownList()
.Name("ddlPatientClass").AutoBind(true)
.HtmlAttributes(new { style = "width: 67px!important;" })
.DataTextField("ModuleName")
.DataValueField("RoleId")
.ContentType("application/json")
.DataSource(source =>
{
source.Read(read => read.Url(Url.HttpRouteUrl("DefaultApi", new { controller = "MedicalVisit", Action = "GetPatientClass" })).Type(HttpVerbs.Get));//.Type(HttpVerbs.Get).Data("ModuleParamCP"));
})
)
請問你的控制器看起來 –