Click here to Skip to main content
15,900,816 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

i have a textbox in dotnetnuke.

i replace '
' into \n for newline in textbox, i try in localhost it's work, but i upload to server it doesn't works..

i try to display with Response.Write the result example:
'Hello..
' but it not work to replace with \n

the code below:
C#
string description = Server.HtmlDecode(b2u.Description).Replace("<br />", "\n");
txtDescription.Text = description;


is there any other way to replace
besides using \n?

can somebody help me??
Posted
Updated 12-Oct-11 23:58pm
v3

Try this

HTML
Replace("<br />", Environment.NewLine);
 
Share this answer
 
XML
string Descripion = e.Item.Cells[9].Text.ToString().Trim();
                Descripion = Descripion.Replace("\n", "<br/>");
                e.Item.Cells[9].Text = Descripion.ToString();
 
Share this answer
 
XML
<div class="display-field">
    <%: new HtmlString(Model.Body.Replace(Environment.NewLine, "<br />")) %>
</div>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900