【发布时间】:2016-01-16 06:05:49
【问题描述】:
我正在服用最后 4 个 4 个 cmets,并希望在工具提示中显示,
我正在执行以下代码,但它显示的内容类似于"System.Collection.Generic.List"
var list = db.PO_Prd_Comments.Where(t => t.PO_TrgCal_ID == item.ID && t.Reply == false).OrderByDescending(t => t.PO_TrgCal_ID).Take(4).ToList();
List<string> comments = new List<string>();
if (list.Count != 0)
{
foreach (var ts in list)
{
comments.Add(ts.PrdComment);
if (list.Count == 1)
{
notify = list.SingleOrDefault().notify;
}
else
{
notify = true;
}
}
}
<td>
<a href="#" onclick="popup4(@CountID)" title="@comments"
<img src="~/Images/comment.GIF"/></a>
</td>
我如何在工具提示中显示这四个 cmets。
【问题讨论】:
-
但是在视图中,请帮助我如何放入列表然后显示
-
举个相关的例子
标签: asp.net-mvc-4 razor