AspdotnetCodes.com
Search
Articles
Books
Resources
Asp.Net News
Downloads
Free Tech Magazines
Asp.Net Web Hosting
Archives
Softwares
Newsletter
Suggest Us
Link to Us
Feeds Subscription
Articles
Questions & Answers
Tips & Tricks
 How to Display a TextArea Text in exact Format?
Posted by Moderator1 on  10/17/2008 9:06:39 AM 7306 Views
Simple as much, replace the new lines with <br /> tag.

And replace all white spaces with '&nbsp;' tag.

For example, look below

Label1.Text = TextBox1.Text.Replace("\n", "<br />").Replace(" ", "&nbsp;");

Post New Tips/Tricks View all Tips/Tricks

Featured Resources:
FierceDeveloper
Is a free weekly email newsletter for the wireless developer community.
Simply JavaScript - Free 150 Page Preview!
Packed with full-color examples, Simply JavaScript is all you need to start programming in JavaScript the right way.
100% Free Subscription until Stock lost.View complete list.
Sponsored by