62,046
社区成员
发帖
与我相关
我的任务
分享
<asp:Repeater ID="RepeaterList" runat="server">
<ItemTemplate>
<table width="410" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="380" id="q_title">
<strong>◆ <a href="QuestionDetail.aspx?questionid=<%#Eval("question_id")%>&gid=<%#Eval("category_group_id")%>">
<%#Eval("question_title") %></strong> </a>
</td>
</tr>
<tr>
<td id="q_content">
<br /><strong>
<asp:Label ID="lblQuestion_content" runat="server" Text="答案:"></asp:Label></strong><asp:Label ID="lblContent" truncateToFit="true" maxWidth="25" runat="server" ForeColor="Gray" Text='<%#Eval("answer_content") %>'></asp:Label>
</td>
</tr>
<tr>
<td width="375">
<hr />
</td>
</tr>
</table>
</ItemTemplate>
</asp:Repeater>
<td id="q_content" style="text-overflow:ellipsis;word-break:keep-all;word-warp:warp;white-space:nowrap;">你的内容</td>
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[2].ToolTip = e.Row.Cells[2].Text;
if (e.Row.Cells[2].Text.Length > 50)
{
e.Row.Cells[2].Text = e.Row.Cells[2].Text.Substring(0, 49) + "... ";
}
}
}
text-overflow:ellipsis;word-break:keep-all;word-warp:warp;white-space:nowrap;