I'm using the MS AJAX AutoCompleteExtender on a textbox. It's working fine, except when the web service returns strings like "0010" -- in which case, it displays "8".
我在文本框上使用MS AJAX AutoCompleteExtender。它运行正常,除非Web服务返回类似“0010”的字符串 - 在这种情况下,它显示“8”。
I eventually realised it was interpreting the string "0010" as an octal number (and then proved the point by adding strings like "0100" and "0x10".)
我最终意识到它将字符串“0010”解释为八进制数(然后通过添加“0100”和“0x10”之类的字符串来证明这一点。)
How can I prevent this? If the web service returns "0010", I want the autocomplete extender to also display "0010", and not interpret it as octal and display a decimal equivalent.
我怎么能阻止这个?如果Web服务返回“0010”,我希望自动完成扩展程序也显示“0010”,而不是将其解释为八进制并显示十进制等效项。
1 个解决方案
#1
Single quote it. JavaScript makes it an int.
单引号吧。 JavaScript使它成为一个int。
#1
Single quote it. JavaScript makes it an int.
单引号吧。 JavaScript使它成为一个int。