问题
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.
回答1:
Single quote it. JavaScript makes it an int.
来源:https://stackoverflow.com/questions/382063/ajax-asp-net-autocompleteextender-interpreting-string-0010-as-octal