Hi, everyone! Could someone tall me how I can limit count of line of text, that is showing in asp.net Label control? Thanks!
+1
A:
You could use this css to define a max width for the cell(or the outer container). To define a max length of the text, you have to truncate the text to your maximum length by yourself.
.longtext td{ width:100px;word-wrap : break-word ;word-break : normal; }
<asp:Label ID="lblText" runat="server" CssClass="longtext">
lblText.Text=lblText.substring(0,yourMaxLength)
Tim Schmelter
2010-10-20 08:00:17
nice solution +1
Muhammad Akhtar
2010-10-20 08:08:38