asp.net:资源.resx文件中的换行符\ n不起作用 [英] asp.net: line break \n in resource .resx file does not work

查看:336
本文介绍了asp.net:资源.resx文件中的换行符\ n不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

\ n在以下代码中不起作用,它只显示为\ n

The "\n" does not work in below code, it's just displayed as "\n"

if (!window.confirm(XXXXX.Globalization.LocalResource.InvalidUrl)) {
    return false;
}

字符串是无效的网址!\ n你确定要的吗?继续?在资源resx文件中。

the string is "Invalid URL! \n Are you sure you want to continue?" in resource resx file.

如何使其工作?

推荐答案

尝试使用shift-enter在设计器中创建一个新行。或者从记事本中复制并粘贴结果。

Try shift-enter to create a new line in the designer. Alternatively copy and paste the result from notepad.

另一种方法是手动编辑RESX xml。

Another way is to edit the RESX xml manually.

问题是RESX设计器UI将自动转义字符串。所以你的价值实际上是:

The problem is that the RESX designer UI will auto-escape the strings. So your value is actually:

"Invalid URL! \\n Are you sure you want to continue?"

这篇关于asp.net:资源.resx文件中的换行符\ n不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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