Using the Label
control, the display text is set during runtime from the database. I am trying to control the maximum width of the control, for example max of 100 per line with additional characters rolled over to the next line.
I tried this by setting and also using CSS with no luck:
lbl_Feedback1.Width = 50;
I believe the issue lies with the fact that the text of the label is updated during run time of the application. How to solve this?
Your label must be set to "display: block" in order to set a width. Either set this in the css-file:
label, span {
display: block
}
or using inline style (from code-behind):
lbl_Feedback1.Style["display"] = "block";
lbl_Feedback1.Style["width"] = "100px";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With