Display label text with line breaks in c#

后端 未结 8 647
面向向阳花
面向向阳花 2020-12-05 09:28

Is it possible to display the label text with line breaks exactly as per the image

\"enter

8条回答
  •  一生所求
    2020-12-05 10:15

    I know this thread is old, but...

    If you're using html encoding (like AntiXSS), the previous answers will not work. The break tags will be rendered as text, rather than applying a carriage return. You can wrap your asp label in a pre tag, and it will display with whatever line breaks are set from the code behind.

    Example:

提交回复
热议问题