Reputation: 2203
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?
Upvotes: 4
Views: 16323
Reputation: 1380
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";
Upvotes: 8