标签:item nbsp entity dict key substring title object val
System.Web.Mvc.ViewPage<dynamic>//这句不清楚到底有没有用,反正我没用到 public ActionResult Index() { IDictionary<string, object> entity = new Dictionary<string, object>();//声明一个字典健值对 List<CiclSingerPic> lpc = new List<CiclSingerPic>();//实体一 List<MSingerPage> lsp = new List<MSingerPage>();//实体二 List<CiclNews> lcn = new List<CiclNews>();//实体三 Dictionary<object, object> dne = new Dictionary<object, object>();//健值对。 lpc = new ProductLogic().ReadHomeMessage(ref lsp, ref dne, ref lcn);//从Model中取值给上面声明的实体及健值对 entity.Add("topb", lpc);//添回到IDictionary entity.Add("about", lsp);//添回到IDictionary entity.Add("dnes", dne);//添回到IDictionary entity.Add("lcn", lcn);//添回到IDictionary return View(entity);//返回视图 } @foreach (var item in (IList<CiclEntity.CiclSingerPic>)Model["topb"])//实体1 { <li><a href="@item.LinkHtml" target="_blank"><img src="@item.ImbBig" alt="@item.Expression" /></a></li> } @{Html.RenderAction("SubString", "public", new { id = ((IList<CiclEntity.MSingerPage>)Model["about"])[2].CContent });} //实体二 @foreach (var item in (Dictionary<object, object>)Model["dnes"])// { <li><a href="/title.html/@item.Key">@item.Value</a></li> }
标签:item nbsp entity dict key substring title object val
原文地址:https://www.cnblogs.com/romanticcrystal/p/12916455.html