【发布时间】:2016-06-28 19:44:16
【问题描述】:
我有一个名为PackageIndex 的操作,我在其中创建包类的列表类型视图。在这个视图中,我使用布局,我必须在导航栏上显示通知...为此我必须将通知列表传递给布局以显示通知..我的代码如下...
public ActionResult PackageIndex()
{
//feedback counter
int count = feedbackCounter();
ViewData["FeedbackCount"] = count;
int notificationcount = notificationCounter();
ViewData["notificationcount"] = notificationcount;
return View(db.packages.ToList());
}
在此操作中,我还必须通过 (db.notification.ToList())...为布局提供数据..我不明白如何解决这个问题...
【问题讨论】:
标签: c# asp.net-mvc asp.net-mvc-3 asp.net-mvc-4