The "\n" does not work in below code, it's just displayed as "\n"
if (!window.confirm(XXXXX.Globalization.LocalResource.InvalidUrl)) {
return false;
}
the string is "Invalid URL! \n Are you sure you want to continue?" in resource resx file.
how to make it work?
ASP.NET MVC
STEP-1
In my
Resource.resx
file putShift+Enter
between the paragraph1 & paragraph2My text paragraph1
My text paragraph2
STEP-2
In my view page its
I used shift+enter, it think it's the simplest.
< br >certainly will not work, have not tried \r\n, but since \n does not work, I am not very confident with \r\n
Try shift-enter to create a new line in the designer. Alternatively copy and paste the result from notepad.
Another way is to edit the RESX xml manually.
The problem is that the RESX designer UI will auto-escape the strings. So your value is actually:
What worked in my case was this:
See the
<br>
there.Look here for the details: Putting a line break in an resx resource file
I'm using Razor in ASP.NET MVC and so I used:
so that it outputs the
<br>
as HTML code.Shift-enter works great when you're entering strings, but if you have already created your resource file, and you dont want to edit every string, you can just do