tags:

views:

13

answers:

1

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
nice solution +1
Muhammad Akhtar