AJAX Asp.net AutoCompleteExtender interpreting string 0010 as octal

北城以北 提交于 2019-12-31 02:55:18

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!