在学习AutoComplete控件的过程中,遇到了下述的问题:
如过把参数名prefixText改成其他名称,就实现不了这个效果(特此记录)
[WebMethod]
public string[] GetResult(string prefixText)
{
//if (count == 0)
//{
// count = 10;
//}
Random ran = new Random(DateTime.Now.Millisecond);
List<string> result = new List<string>(10);
for (int i = 0; i < 10; i++)
{
char a = (char)ran.Next(65, 78);
char b = (char)ran.Next(97, 111);
result.Add(prefixText + a + b);
}
return result.ToArray();
}