Jan 16, 2009, 2:11 AM
How to Create a portlet dynamically?
Hi Guys,
I want to create a portlet dynamically in code behind, i tried to execute below set of lines,its not working.
i am pretty much thankful,if any one of guys helped me out.
Mohan
I want to create a portlet dynamically in code behind, i tried to execute below set of lines,its not working.
i am pretty much thankful,if any one of guys helped me out.
ColumnLayout ColumnLayout2 = new ColumnLayout();
LayoutColumn LayoutColumn2 = new LayoutColumn();
LayoutColumn2.ColumnWidth = decimal.Parse(".33");
PortalColumn PortalColumn2 = new PortalColumn();
PortalColumn2.ID = "PortalColumn2";
PortalColumn2.StyleSpec = "padding:10px 0 10px 10px";
AnchorLayout AnchorLayout2 = new AnchorLayout();
Portlet Portlet2 = new Portlet();
Portlet2.ID = "Portlet2";
Title = "Portlet 2";
Anchor anchor = new Anchor();
anchor.Horizontal = "100%";
anchor.Items.Add(Portlet2);
AnchorLayout2.Anchors.Add(anchor);
PortalColumn2.Body.InstantiateIn(AnchorLayout2);
LayoutColumn2.Items.Add(PortalColumn2);
Thanks & RegardsMohan