Multiline label in asp.net

后端 未结 5 1942
感动是毒
感动是毒 2021-01-17 14:09

I want to use a multiline label but as the control is browser dependent, even on setting the height, width and wrap properties of the label control I am unable to display mu

5条回答
  •  时光说笑
    2021-01-17 14:27

    Labels are single line by default.

    But if you want to display multiple lines in a text box, then there is one option that might work. I could not get autowrap to work, but if you want specific line breaks to occur, then

    label.text = string1 + "
    " + string2 + "
    " + string3;

    It may seem simple, but the C# Environment.Newline did not work in aspx. Only rendering the
    worked for me.

提交回复
热议问题