sitecore6 - Sitecore: How to get sublayout ITEM from sublayout codebehind? -
i'm trying sublayout item (or item id) in codebehind. is possible?
update:
i not mean datasource item or current item, i'm talking sublayout rendering definition item. has 1-to-1 relationship sublayout file.
codebehind file:
public partial class product_sublayout : system.web.ui.usercontrol { protected void page_load(object sender, eventargs e) { sublayout sublayout = this.parent sublayout; item sublayoutitem = null; //how sublayout rendering definition item here? } }
this page explain details, here's code need:
sitecore.context.database.getitem(((sublayout)parent).datasource);
update:
you can rendering item using database id:
sitecore.context.database.getitem(((sublayout)parent).renderingid);
Comments
Post a Comment