Ho do I preserve the layout of text in a TextArea control in asp.net ?
e.g.
"This is some text:
- line 1 text
- line 2 text
- line 3 text"
Ho do I preserve the layout of text in a TextArea control in asp.net ?
e.g.
"This is some text:
- line 1 text
- line 2 text
- line 3 text"
asked this so i post the answer, as I couldnt find it anywhere else online...
You just need to prefix the text string with '@' and the text will retain its layout. e.g.:
<%=Html.TextArea("sample", @"This is some text:
- line 1 text
- line 2 text
- line 3 text", 10, 20, null)%>