mvc返回多个结果集,返回多个视图
标签:item nbsp entity dict key substring title object val
System.Web.Mvc.ViewPagedynamic>//这句不清楚到底有没有用,反正我没用到
public ActionResult Index()
{
IDictionarystring, object> entity = new Dictionarystring, object>();//声明一个字典健值对
List lpc = new List();//实体一
List lsp = new List();//实体二
List lcn = new List();//实体三
Dictionaryobject, object> dne = new Dictionaryobject, 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)Model["topb"])//实体1
{
"@item.LinkHtml" target="_blank">"@item.ImbBig" alt="@item.Expression" />
}
@{Html.RenderAction("SubString", "public", new { id = ((IList)Model["about"])[2].CContent });} //实体二
@foreach (var item in (Dictionaryobject, object>)Model["dnes"])//
{
"/title.html/@item.Key">@item.Value
}
mvc返回多个结果集,返回多个视图
标签:item nbsp entity dict key substring title object val
原文地址:https://www.cnblogs.com/romanticcrystal/p/12916455.html
评论