Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 我想在通知视图中显示发件人名称和产品名称 public ActionResult ShowNotification()//向用户显示 { int currentUserId=(int)会话[“currentUserId”]; IEnumerable productOfferModels=IPProductOfferPO.Getoffer()。其中(s=>s.SenderId!=currentUserId)。ToList();//获取所有产品报价列表 IEnumerable userModels=iUserRepo.GetUser().ToList();//获取所有用户模型 返回视图(“~/Views/Home/ShowNotification.cshtml”,productOfferModels); }_C#_Asp.net Mvc_Linq_View - Fatal编程技术网

C# 我想在通知视图中显示发件人名称和产品名称 public ActionResult ShowNotification()//向用户显示 { int currentUserId=(int)会话[“currentUserId”]; IEnumerable productOfferModels=IPProductOfferPO.Getoffer()。其中(s=>s.SenderId!=currentUserId)。ToList();//获取所有产品报价列表 IEnumerable userModels=iUserRepo.GetUser().ToList();//获取所有用户模型 返回视图(“~/Views/Home/ShowNotification.cshtml”,productOfferModels); }

C# 我想在通知视图中显示发件人名称和产品名称 public ActionResult ShowNotification()//向用户显示 { int currentUserId=(int)会话[“currentUserId”]; IEnumerable productOfferModels=IPProductOfferPO.Getoffer()。其中(s=>s.SenderId!=currentUserId)。ToList();//获取所有产品报价列表 IEnumerable userModels=iUserRepo.GetUser().ToList();//获取所有用户模型 返回视图(“~/Views/Home/ShowNotification.cshtml”,productOfferModels); },c#,asp.net-mvc,linq,view,C#,Asp.net Mvc,Linq,View,在您的代码返回视图(productOfferModels)中进行此更改您的问题是什么?代码部分需要采用文本格式,而不是图像格式。 public ActionResult ShowNotification() // showing to user { int currentUserId = (int)Session["CurrentUserId"]; IEnumerable<ProductOfferModel> productOfferMod


在您的代码
返回视图(productOfferModels)中进行此更改

您的问题是什么?代码部分需要采用文本格式,而不是图像格式。
public ActionResult ShowNotification()     // showing to user
{
    int currentUserId = (int)Session["CurrentUserId"];
    IEnumerable<ProductOfferModel> productOfferModels = iProductOfferRepo.Getoffer().Where(s => s.SenderId != currentUserId).ToList();  // get all product offer list
    IEnumerable<UserModel> userModels = iUserRepo.GetUser().ToList(); //get all user model
    return View("~/Views/Home/ShowNotification.cshtml",productOfferModels);
}