我在网上搜索到大多数人认可的代码,可是的我应用时却无法实现。
CSS代码
</style>
<style type="text/css">
.mlength
{
display: block;
width: 180px;
overflow: hidden;
white-space: nowrap;
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
}
设置GridView的某一字段为模板列并设置css与设置ToolTip
<asp:Label ID="Label1" runat="server" Text='<%# Eval("字段") %>' CssClass="mlength" ToolTip='<%# Eval("字段") %>'></asp:Label>
不懂为什么实现不了?