internal server error

27 views
Skip to first unread message

molinom...@gmail.com

unread,
Dec 15, 2015, 6:53:19 AM12/15/15
to select2
Hi, i'm for first time using select2 for autocomplete dropdownlist and i'm getting this error after server call:

GET http://localhost:50970/Commitment/Customers?q=i 500 (Internal Server Error)
send @ jquery-2.1.4.js:8630
jQuery.extend.ajax @ jquery-2.1.4.js:8166
b.transport @ select2.min.js:2
d @ select2.min.js:2

This is client side:

var customerCache = [];

$(".select2-me").select2({
ajax: {
url: '@Url.Action("Customers", "Commitment")',
dataType: 'json',
delay: 250,
data: function (params) {
return {
q: params.term // search term
};
},
processResults: function (data) {
customerCache = [];

$.each(data, function (idx, value) {
customerCache[value.Code] = value;
});

return {
results: data
};
},
cache: true
},
});

});

and if need server side:

public JsonResult Customers(string q)
{
var customers = CustomerDM.GetList(q);

return Json(customers, JsonRequestBehavior.AllowGet);
}

Someone can help me?

Reply all
Reply to author
Forward
0 new messages