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

Drop Down List with AJAX

3 Answers 210 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 13 Dec 2012, 07:42 PM
I am trying to load a drop down list, with data from AJAX.   When it loads, I get the "waiting" circle over the list continually.  I looked at the example, and noticed the same behavior.

View Code:
<fieldset class="form-list"> <ol> <li> <label>Project *</label> @(Html.Kendo().DropDownList()   .Name("1Project")   .DataTextField("DisplayName")   .DataValueField("ProjectID")   .DataSource(source =>   {   source.Read(read =>   {   read.Action("ProjectList""ReturnMail");   });   }) ) </li> <li> <label>Name Address 1</label> <input type="text" id="1NameAddress1" class="k-textbox" /> </li> <li> <label>Name Address 1</label> <input type="text" id="1NameAddress2" class="k-textbox" /> </li> <li> <label>Name Address 1</label> <input type="text" id="1NameAddress3" class="k-textbox" /> </li> <li> <label>Name Address 1</label> <input type="text" id="1NameAddress4" class="k-textbox" /> </li> <li> <label>Name Address 1</label> <input type="text" id="1NameAddress5" class="k-textbox" /> </li> <li> <label>City</label> <input type="text" id="1City" class="k-textbox" /> </li> <li> <label>State</label> <input type="text" id="1State" class="k-textbox" maxlength="2" /> </li> <li> <label>&nbsp;</label> <button id="SearchAddressButton" class="k-button primary">Search</button> </li> </ol> </fieldset> 

Controller Code:
public JsonResult ProjectList(string userName = "") { if (userName == "") userName = Request.ServerVariables["AUTH_USER"]; List<ProjectModel> proj = ProjectModel.AllProjects(); return Json(proj); } 

3 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 14 Dec 2012, 09:43 AM
Hello Richard,

 
If the load image continues to spin, then I believe there is a server error. You can use web developer tool (FireFox etc.) to validate this. Nevertheless I believe the problem is in the 

return Json(proj);
As you probably know the ASP.NET MVC does not allow GET requests and you will need to define second parameter JsonRequestBehavior.AllowGet.

Regards,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Jason
Top achievements
Rank 1
answered on 18 Dec 2012, 02:20 AM
I've spent hours resolving issues embedding drop-down lists into grids.

Perhaps if Telerik fixed the samples it would help :/

This one doesn't include the controller:
http://demos.kendoui.com/web/dropdownlist/remotedatasource.html

This one has source for an unrelated example:
http://demos.kendoui.com/web/grid/editing-custom.html

Moving to KendoUI has been agonizing for us, primarily because the documentation and examples have been so lacking compared to the original MVC version.
0
Georgi Krustev
Telerik team
answered on 18 Dec 2012, 01:42 PM
Hello Jason,

 
Consolidation of the demos for the different technologies is in our TODO list for the upcoming official release of Kendo UI. If you have any suggestions about the Kendo UI documentation, please share them. Thus we will be able to improve it in the right direction. Also there are tutorials, which covers the migration path between Telerik Extensions for ASP.NET MVC and Kendo UI Complete for ASP.NET MVC.

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