[MyFirstHome] public ActionResult Index() { View_Home view_Home = null; var IsStaticHtml = Convert.ToBoolean(Session["IsStaticHtml"]); if (!IsStaticHtml) { view_Home = new View_Home(); using (BangLiEntities bangLi = new BangLiEntities()) { view_Home.CommandAdExtendList = Dal.CommandAdDal.Instance(bangLi).GetInit().ToList(); view_Home.NewsExtendList = Dal.NewsDal.Instance(bangLi).GetInit().OrderByDescending(u => u.AddDateTime).Take(5).ToList(); } return View(view_Home); } else { return null; } }
说明:可以让一个超链接或跳转地址直接跳转到一个html的静态页面,速度会更快;