通过页面[“propertyName”]访问属性和EPiServer中的page.Property [“propertyName”]有什么区别?
感谢名单!
答案 0 :(得分:1)
page [“PropName”]使用PageData类的索引器返回PropertyData对象的Value。
page.Property [“PropName”]将返回整个PropertyData对象(例如PropertyLongString)
所以page [“PropName”]等于page.Property [“PropName”]。值
答案 1 :(得分:0)
不确切知道。但...
我总是使用页面[“PropName”],我知道它可以使用“从中获取数据”和“动态属性”,当你有一个可写页面时,它也适用于设置值。
从我从多个合作伙伴和EPiServer课程中看到的代码判断,这也是最常见的方式。
您可以在这里查看实施并找出确切的结果: http://sdk.episerver.com/library/cms5/html/T_EPiServer_Core_PageData.htm
答案 2 :(得分:0)
正如比约恩所说:
CurrentPage [“PropertyName”] 与 CurrentPage.Property [“PropertyName”]相同。值。