jquery - KendoUI DropDownList to populate textboxes with data results using JavaScript -


thanks in advance...

i'm new kendoui controls , trying resolve issue i'm having updating textbox fields upon changing item in kendo dropdownlist control.

i'm populating dropdownlist using viewdata method when view loaded , calling json result method returns specific row use populate textbox fields.

i'm able hit json event, reason error in jquery.min.js (jquery v1.9.1) file , function(data) never fires off , skips altogether.

here's error jquery.min.js file...

get http://localhost:52078/settings/getetilizelocale/7 500 (internal server error)       jquery.min.js:19 b.ajaxtransport.send jquery.min.js:19 b.extend.ajax jquery.min.js:19 b.each.b.(anonymous function) jquery.min.js:19 ddlchange viewlocales:192 i.extend.trigger kendo.all.min.js:9 o.extend._change kendo.all.min.js:14 o.extend._blur kendo.all.min.js:14 o.extend._focus kendo.all.min.js:14 o.extend._accept kendo.all.min.js:15 o.extend._click kendo.all.min.js:14 b.extend.proxy.b.isfunction.i jquery.min.js:4 b.event.dispatch jquery.min.js:4 b.event.add.v.handle 

here's code...

js view

    //auto populate other edit popup fields when ddl changes value      function ddlchange(e) {                     $.get("/settings/getetilizelocale/" + $("#etilizelocaleid").data().kendodropdownlist.value(), function (data)         {             alert($('#name').value());             //$('#name').val(data.name);             //$('#languagecode').val(data.languagecode);             //$('#countrycode').val(data.countrycode);             //$('#isactive').val(data.isactive);         });                 } 

c# controller

public actionresult getetilizelocale(int id = 0)     {         var datacontext = new etilizeentities();         etilize_locale loc = datacontext.etilize_locale.find(id);          return json(loc);     } 

finally figured out!

had change

return json(loc) 

to

return json(loc, jsonrequestbehavior.allowget); 

for else ever runs issue.


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -