我有一个详细信息页面,它返回一个基本用于从数据库中查找页码的配置文件视图。我还有一个单独的查询,我想在返回视图中返回,但不知道怎么做。我的代码是
public ActionResult detail(int id)
{
profile profile = db.profiles.Find(id);
var currentpage = (from s in db.profiles where id == s.profileID select s.registrationID).FirstOrDefault();
var articles = (from s in db.Articles where currentpage == s.RegistrationID select s.title).FirstOrDefault();
ViewBag.articles = articles;
ViewBag.noprofiler = " This profile currently doesn't have the email profiler selected";
return View(profile);
}
我也想退回文章,我把它放进了一个viewbag但这没有任何想法?