asp.net mvc convert \n new line to html breaks

前端 未结 11 596
逝去的感伤
逝去的感伤 2020-12-14 15:10

I have a textarea in mvc. When data is entered into that and I\'m displaying it back to the user, how do I show the line breaks?

I display like this:

11条回答
  •  执笔经年
    2020-12-14 16:02

    I think this answer solves the problems in a nice way, just using css: style="white-space: pre-line" check also: CSS white space property.

提交回复
热议问题