Lets
say we are having label as below.
<asp:Label
CssClass="ShortDesc" Text='<%#
Eval("NewsDescription")%">'
runat="server""></asp:Label">
By
Using CSS
.ShortDesc{
height:50px; Overflow:hidden; }
OR
restrict to 100 or N characters
<asp:Label
CssClass="ShortDesc" Text='<%#
Eval("NewsDescription").ToString().SubString(0,Math.Min(100,Eval("NewsDescription").ToString().Length))
%">' runat="server""></asp:Label">
OR
return a Short Desc from your DB SELECT substring(NewsDescription,1,100)+'...'
AS ShortNewsDescription, NewsDescription From Jobs
And
use that in your repeater <asp:Label CssClass="ShortDesc"
Text='<%# Eval("ShortNewsDescription")%">'
runat="server""></asp:Label">
No comments:
Post a Comment