我有一个调用其数据源子项的呈现。每个子项都在渲染字段中附加了一个渲染。 我打电话将参数传递给使用Sitecore中的ItemRendering进行呈现
@Html.Sitecore().ItemRendering(item)
哪个有效。
但是我想传递一些参数给孩子的渲染,所以我尝试了下面的代码;
@Html.Sitecore().ItemRendering(item, new { Parameters = "active=1" })
但参数没有得到传递给孩子渲染当我打电话@Html.Sitecore().CurrentRendering.Parameters["active"]
所以,我想@Html.Sitecore().ItemRendering(item, new { Active = 1 })
。我在儿童渲染中再次调用它,但仍然没有运气。
有没有办法使用@Html.Sitecore().ItemRendering()
尝试在视图中调用'Model.Rendering.Properties [“Active”]''。 – jammykam
我是否必须将它作为新的{Parameters =“active = 1”}或新的{Active = 1}在ItemRendering中传递? –
它应该是'new {Active = 1}',但是我还没有使用MVC中的参数进行静态绑定,但 – jammykam