Html – Line Break in TextBox or Html Area

asp.nethtmlvb.net

What is the way of separating Line-Breaks and Space in MultiLine Textbox or HTML Text area while inserting database (Asp.Net). For example what should I do if I want to insert

Hello

World

to database with line breaks? And also While displaying what should I do? I don't want to use Editor for it.


But the problem is how to seperate line break and space. Now when I insert

Hello

World

or hello world, it is saved with same character in the database. Therefore I can't separate them and I am showing hello world although user uses line breaks such as above. The value, which comes from TextBox or html area, are the same as with line break or space.

Best Answer

The line breaks should persist to the db. When you retreive the info and display as Html just replace the line break (i.e. Environment.NewLine) with a line break tag (i.e. < b r / > )