使用下面的代码,我有两个形状结果:
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文件显示它?