zoukankan      html  css  js  c++  java
  • mvc返回多个结果集,返回多个视图

    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>
              }
  • 相关阅读:
    字节流
    类File
    try...catch语句
    Collections工具类
    类TreeMap
    类HashMap
    类TreeSet
    jquery 选择器加变量
    bootstrap 事件shown.bs.modal用于监听并执行你自己的代码【写hostmanger关联部门遇到的问题及解决方法】
    jquery中append、prepend, before和after方法的区别(一)
  • 原文地址:https://www.cnblogs.com/ilookbo/p/4059642.html
Copyright © 2011-2022 走看看