The autocompleteextender control displays undefined and null phenomena.

Source: Internet
Author: User

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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.