小编S t*_*ley的帖子

如何在Orchard的单个页面上显示两个形状结果?

使用下面的代码,我有两个形状结果:

public ActionResult CompareRevisions(List<String> Ids)
{
  contentItemLeft = // code to get a ContentItem         
  contentItemRight = // code to get a ContentItem
  dynamic modelLeft = Services.ContentManager.BuildDisplay(contentItemLeft);
  dynamic modelRight = Services.ContentManager.BuildDisplay(contentItemRight);
  var ctx = Services.WorkContext;
   ctx.Layout.Metadata.Alternates.Add("Layout_Null");
   var shapeResultLeft = new ShapeResult(this, modelLeft);
   var shapeResultRight = new ShapeResult(this, modelRight);
   return shapeResultLeft;
}
Run Code Online (Sandbox Code Playgroud)

当我返回任何一个形状结果时,例如return shapeResultLeft在Controller的最后一行,浏览器会完美显示内容.不过,我怎么可以显示我的ShapeResults的:shapeResultLeft,shapeResultRight 在页面同一时间?

如何返回ShapeResults列表并使用View/Layout文件显示它?

orchardcms c#-4.0 orchardcms-1.8

1
推荐指数
1
解决办法
146
查看次数

标签 统计

c#-4.0 ×1

orchardcms ×1

orchardcms-1.8 ×1