C#代码控制
<%#Convert.ToString(DataBinder.Eval(Container.DataItem, "title")).Length>15?Convert.ToString(DataBinder.Eval(Container.DataItem, "title")).Substring(0,15):DataBinder.Eval(Container.DataItem, "title")%>
CSS控制<html>
<head><title></title>
<style type="text/css">
<!--
a {
width:160px;
white-space:nowrap;
text-overflow:ellipsis;
overflow: hidden;
TEXT-DECORATION:none;
}
-->
</style>
</head>
<body>
<a href="#">abcdefghijklmnopqrstuvwxyz</a>
</body>
</html>
<head><title></title>
<style type="text/css">
<!--
a {
width:160px;
white-space:nowrap;
text-overflow:ellipsis;
overflow: hidden;
TEXT-DECORATION:none;
}
-->
</style>
</head>
<body>
<a href="#">abcdefghijklmnopqrstuvwxyz</a>
</body>
</html>