Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i use this code to bring user's names from database :

//javaScript
JavaScript
function OnUserChange(s, e) {
$(s.GetInputElement()).autocomplete({
source: function (request, response) {
$.ajax({
type: 'POST',
contentType: "application/json; charset=utf-8",
url: global.path + '/Mail/NewMail.aspx/GetUsers',
data: "{'keyword':'" + request.term + "'}",
dataType: "json",
async: false,
success: function (data) {
data = jQuery.parseJSON(data.d);
response($.map(data, function (item) {
return {
label: item.FullName,
value: item.FullName,
id: item.UserID
}
}))
}
});
}
});
}


//get user to use it in auotocomplete textbox
C#
  [WebMethod]
   public static string GetUsers(string keyword)
   {
       User user = new User();
       string jsonData = JsonConvert.SerializeObject(user.GetAllUsers(keyword));
return jsonData;
}



how can i pass this function to asptokeninput control to get multiple autocomplete values
please help me
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900