$(function () {
$('#DRMCompanyId').autocomplete({
source: function (request, response) {
$.ajax({
url: '@Url.Action("compSearch", "AgentTransmission")',
type: 'GET',
dataType: 'json',
data: request,
success: function (data) {
response($.map(data, function (value, key) {
return {
label: value,
value: key
};
}));
}
});
},
minLength: 2
});
});
Refer this link for more
http://stackoverflow.com/questions/16219026/jquery-use-key-value-pair-in-autocomplete[
^]