Resource file variable giving string ASCII code issues in js alert box

和自甴很熟 提交于 2019-12-13 02:23:26

问题


I have a variable in a resource file (.resx), the value having the word you'd.

When I try to use this variable directly in an alert box it displays you'd as you'd.

What could be the issue? and how do I resolve it?


回答1:


Try this:

alert('@System.Web.HttpUtility.JavaScriptStringEncode("Hello, You'd like this.")');



来源:https://stackoverflow.com/questions/17919697/resource-file-variable-giving-string-ascii-code-issues-in-js-alert-box

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