Multiline text in Web.Config file

I need to display a welcome message on a web page. I would like to have the text of the message saved in the Web.Config file. The text will contain line breaks.

eg.

<appSettings>
<add key="Test" value="Hello 

     There

     How are you?"/>
</appSettings> 

However, when I show this, everything returns to 1 line.

Does anyone help?

I am using ASP.Net 4.0

Thanks in advance

+3
source share
1 answer

You can do this as Nick said, but I prefer the constants to be in your application: App_GlobalResources or App_LocalResources.

Then you can have support for multiple languages ​​and everything is clean ... but if you don't want to rebuild every time you change the constants, you can put the text in a database or xml file.

web.config

+4

All Articles