AJAX Asp.net AutoCompleteExtender interpreting string 0010 as octal
-
23-08-2019 - |
Question
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".
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".)
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.
Solution
Single quote it. JavaScript makes it an int.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow