Entity dynentity2 = collection.Entities[i]; if (dynentity2.Attributes.Count > 0 && dynentity2.Attributes.Contains("systemuserid")) { string strUserId = string.Empty; string strUserName = string.Empty; if (dynentity2.Attributes.Contains("systemuserid")) strUserId = Convert.ToString((dynentity2.Attributes["systemuserid"])); if (dynentity2.Attributes.Contains("fullname")) strUserName = Convert.ToString((dynentity2.Attributes["fullname"])); UserItem objItem = new UserItem(); objItem.UserId = strUserId; objItem.UserName = strUserName; lstUsers.Add(objItem); } Autocomplete textbox web method by typing username, returns List collection: [System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()] public static List GetCompletionList(string prefixText, int count, string contextKey) { List objReturnList = new List(); try { var products = lstUsers.Select(p => p.UserName.ToLower().StartsWith(prefixText.ToLower())).ToList(); foreach (UserItem objItem in lstUsers) { if (objItem.UserName.ToLower().StartsWith(prefixText.ToLower())) { objReturnList.Add(objItem.UserName); } } return objReturnList.Distinct().ToList(); } catch (Exception ex) { throw ex; } finally { objReturnList = null; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)