Carriage Return in Web.config file?

  • Thread starter Thread starter Waldy
  • Start date Start date
W

Waldy

Hi there,
I am reading a string from a web.config file and displaying
it in a label on an .ASPX page. I want a carriage return in the string so
that it looks right, but can't get it to put one in.. I have tried using \n
and
e.t.c. in the config file setting but none of those produce a
carraige return in the output. Is this possible?
 
<br />

Hi Mark,
I've tried that, but it doesn't work. It crashes the
application if you just enter <br/> in the web.config file and if you escape
the less than / greater than characters, it just comes out as <br/> in the
text.
 
Hi,

<appSettings>
<add key="XXX" value="XXX-zzzz" />

</appSettings>

-------------------------------------------------------------------

Label1.Text = ConfigurationManager.AppSettings("XXX").Replace("-", "<br />")

HTH,

S. Serrano P.
Sistemas
JABSOFT
blog: http://dotnet-peru.blogspot.com
511-91974972
511-2428802


--------------------------------------------------------------------------------


"Waldy" <[email protected]> escribió en el mensaje <br />

Hi Mark,
I've tried that, but it doesn't work. It crashes the
application if you just enter <br/> in the web.config file and if you escape
the less than / greater than characters, it just comes out as <br/> in the
text.
 
Mark Rae said:

Mark,
you were right. I realised that I was using a span directly
rather than an asp:label to render a span. If you set the label text it
does process the <br> and render a new line.
 
Hi Mark,
I've tried that, but it doesn't work. It crashes the
application if you just enter <br/> in the web.config file and if you escape
the less than / greater than characters, it just comes out as <br/> in the
text.

Try a Literal instead of a Label.
 
Back
Top