Question: i have multi line textbox in my asp.net page. when user enter some data in that i store the data in database table. now when i display the data back to the page the ENTER which user has pressed while entering the data get lost and all the data is displayed in same line. so i want to save the ENTERs pressed while entering data and display the data in the form it was being entered.plz help

Answer: 
HTML [collapses whitespace](http://www-sul.stanford.edu/tools/tutorials/html2.0/whitespace.html): the newline characters are indeed stored in the database, but are rendered as space characters on the page.

You can replace the newline characters with `<br />` elements when rendering:

```
yourLabel.Text = Server.HtmlEncode(yourData).Replace("\n", "<br />");

```

There's no easy solution to restore tabulation characters, though, apart from rendering your data in a multiline read-only `TextBox` control.
Typically, when a user presses the tab key in a multi-line textbox or textarea, the focus will jump to the next html page element, and therefore the user will not be able to add a tab to their input. If, however, the user copies and pastes their text from Word for example, the tab will be retained and saved to the SQL database. If this is the case, you can simply open a blank Word document, enter a tab, highlight the tab, then copy and paste it into a replace statement, replacing it with `&nbsp` or a css span with left-margin set to `20px`. It should then render correctly when you display the entry in read mode. The following code replaces both tabs and newlines in the rendered entry.

```
objLabel = FindControl(strQuestionId)
strReformattedText = reader("Answer").Replace(System.Environment.NewLine, "<br />")
strReformattedText = strReformattedText.Replace("   ", "&nbsp;&nbsp;&nbsp;&nbsp;") 'Replace tab character with &nbsp;
objLabel.Text = strReformattedText

```