资源文件变量在js警报框中给出了字符串ASCII代码问题 [英] Resource file variable giving string ASCII code issues in js alert box

查看:92
本文介绍了资源文件变量在js警报框中给出了字符串ASCII代码问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在资源文件(.resx)中有一个变量,该值的单词为you'd.

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

当我尝试直接在警报框中使用此变量时,它会将you'd显示为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?

推荐答案

尝试一下:

alert('@ System.Web.HttpUtility.JavaScriptStringEncode(你好,你想要这个.")');

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

这篇关于资源文件变量在js警报框中给出了字符串ASCII代码问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆