Click here to Skip to main content
15,902,198 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hai all,

I have to display multi line textbox values into the mail. How can I show the newline (using Enter key )that entered into the textbox?
Thanks...
Posted

In textbox property Textmode choose multiline
 
Share this answer
 
Comments
Neha Thanka 21-Jul-11 0:04am    
I am using multiline property and it is working. but I have to display the newline character entered in another place.
Rakesh From Patna 21-Jul-11 0:25am    
you try this:-
TextBox2.Text = TextBox2.Text.Replace(Environment.NewLine, "<br />");

Here textbox2 is my textbox name
Incase you are sending HTML Format emails, then replace "\r\n" by "<br />" in your string.
 
Share this answer
 
v2
you should find the output text from a database, whether in the form (&amp;amp;lt; br \&amp;amp;gt;) or (&amp;lt; br \ &amp;gt;) or (<br />).

if you already know the output of the database use the replace function.

example: string description = HttpUtility.HtmlDecode (b2u.Description). Replace ("<br \>", "\ n");
 
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