This is a migrated thread and some comments may be shown as answers.

kendoDropDownList

1 Answer 89 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
karan
Top achievements
Rank 1
karan asked on 31 May 2013, 06:38 PM
 My html is:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title></title><link href="../../Content/kendo.common.min.css" rel="stylesheet" type="text/css" /><link href="../../Content/kendo.default.min.css" rel="stylesheet" type="text/css" /><link href="../../Content/examples-offline.css" rel="stylesheet" type="text/css" /><script src="../../Scripts/jquery.min.js" type="text/javascript"></script><script src="../../Scripts/kendo.web.min.js" type="text/javascript"></script><script src="../../Scripts/console.js" type="text/javascript"></script></head><body><select id="size"></select><script >$(document).ready(function() {$("#size").kendoDropDownList({dataTextField: "Text",dataValueField: "Value",dataSource: {transport: {read: {dataType: "jsonp",url: "/Grid/GetStateList",}}}});});</script></body></html>  And Controller is     public JsonResult GetStateList()        {            List<ListItem> list = new List<ListItem>() {                new ListItem() { Value = "1", Text = "One" },                new ListItem() { Value = "2", Text = "Two" },                new ListItem() { Value = "3", Text = "Three" }            };            return this.Json(list,JsonRequestBehavior.AllowGet);         /*   in MVC v3,v2   Json is blocked for GET requests (as you can tell from the error) for security reasons. If you want to override that behavior, check out the overload for Json that accepts a JsonRequestBehavior parameter.*/        }   But I am Unable to bind kendo dropdown in case of remote data .In case of local data its working fine .What changes should be done so that  kendoDropDownList can be bound ?Thank and Regards,Karan ShahSoftware Engineer,GIPL

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 04 Jun 2013, 02:27 PM
Hello Karan,

Have you added support for JSONP requests? If not, you should change the dataType to "json".

Regards,
Daniel
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
DropDownList
Asked by
karan
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or