Recently, I have studied Ajax Control Toolkit and found a problem when using autocompleteextender to automatically input and complete controls. Maybe this is a bug of Microsoft. If the returned array is a pure number, it is undefined (not 0) or null (0 is null ).
[System. Web. Services. webmethodattribute (), system. Web. Script. Services. scriptmethodattribute ()]
Public static string [] getcompletionlist (string prefixtext, int count, string contextkey)
{
String [] S = new string [3];
For (INT I = 0; I <3; I ++)
{
S [I] = I. tostring ();
}
Return S;
}
In the above case,: NULL, undefined, undefined will be returned. If we change
[system. web. services. webmethodattribute (), system. web. script. services. scriptmethodattribute ()]
Public static string [] getcompletionlist (string prefixtext, int count, string contextkey)
{< br> string [] S = new string [3];
S [0] = "Chinese ";
S [1] = "ABC";
S [2] = "123abc";
return S;
}< br> true values are returned.
I still don't know why numeric strings become undefined and null. Maybe it's related to JavaScript definition!