Putting a line break in an resx resource file

I had a Label control that I wanted to populate from a resource file, like so:

 <asp:Label ID="lblNote" runat="server" Text="<%$ Resources:AppInfo, Note%>" />

I needed to put a line break in the middle of the text.  To do that, I wanted to put a “<br>” in the text, but since the resource file complained when I tried to put greater than and less than symbols, I had to be sly about it. So in the AppInfo.resx file, I had this entry to add a line break:

   <data name="Note" xml:space="preserve">
    <value>Note: I want this to be the first line and &lt;br&gt;this to be the second.</value>
  </data>
About these ads
  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: