开发者

Label control in ItemTemplate tag in TemplateField tag in Gridview control

I am using a label control in ItemTem开发者_Go百科plate tag in TemplateField tag in Gridview Control to show a field of data of my database . I want if a length of data is higher than 100 charachter the label control doens't show all of data.

<ItemTemplate>
<asp:Label ID="label4" runat="server" Text='<%# Bind("Description") %>' Width="200px" Font-Names="B Nazanin" EnableTheming="false" Height="24px" BorderStyle="Dashed"></asp:Label>
</ItemTemplate>

What should I do ?


This is the simplest approach:

Text='<%# Eval("Description").ToString().Substring(0, 100) %>'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜