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

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:
' but it not work to replace with \n

the code below:
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??
Updated 12-Oct-11 23:58pm

Try this

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