Hi, I am creating a dropdownlist as follows:
Create Widget:
html.Kendo().DropDownList().Name(widgetName).DataSource(source => { source.Custom().Transport(new { read = new Kendo.Mvc.ClientHandlerDescriptor() { HandlerName = "GetPromptData" } }); }).HtmlAttributes(new { id = widgetName, selectId = RegexHelper.GetIndex(parameter) })GetPromptData:
function GetPromptData(options) { $.ajax({ url: "FileSubmit/GetPromptData", datatype: "jsonp", data: { "selectId": $('#widgetName').attr("selectid"), "key": window.dataKey }, contentType: 'application/json', success: function (data) { alert("Data is received"); options.success(data); } });}And finally my controller:
public JsonResult GetPromptData(string selectId, string key){ List<string> items = new List<string>(); items.Add("item1"); items.Add("item2"); return Json(items, JsonRequestBehavior.AllowGet);}The ajax call receives a response but from there nothing happens?