Im working on a bulk email sending app and have a page with a multiline textbox which I am wanting to use as a way of allowing a user to enter the email body text.
I need to format the text within my textbox to HTML, most importantly I need to format linebreaks to HTML, however I cant seem to do this.
The method everyone seems to say to use is:
textOut.Replace("\r\n", "<br />")
But this just does nothing. My Textbox looks like this:
<asp:TextBox runat="server"
ID="txtMailBody"
TextMode="MultiLine"
Width="650"
Height="150"/>
When I enter text in the textbox such as:
Line 1
Line 2
Line 3
It always outputs like
Line 1 Line 2 Line 3
Am I doing something wrong here?
Try this
Hope it helps