I have this textbox
Code
and I want the text to be displayed in 3 lines.
Implementare masuri de protectie stabilite
Verificarea respectarii masurilor implementate
Instruirea lucratorilor
I tried inserting
and
but is not working. What other options do I have? I can put a label with a fixed height but first I want to make sure it cannot be done in the form it is now


Prasad RaveendranRank #320 · 7.8K reputationPosted Dec 2, 2023, 10:09 AM EST
In the context of an ASP.NET TextBox control with TextMode="MultiLine", setting the Text property directly won't interpret HTML tags like
. Instead, you can add newline characters\r\nwithin the Text property to display the text in separate lines. Here's an example:This approach will render the text in the TextBox control across three separate lines when the page loads, without the need for HTML
tags. Each\r\nsequence represents a line break in the TextBox's multiline display.Marius VasileRank #785 · 2.9K reputationPosted Dec 2, 2023, 11:38 AM EST
I already tried that and it was not worning. Somehow that multiline is messing with
I end up using
just to get the result I needed