Aug 15, 2013, 9:59 AM
[CLOSED] How to change and save Portal control's content ??
I want to dynamic add Portal control's content .
But I encountered two problems.
1)When PortletReSet mehtod executed, the Portal control's content does not change?
2)In PortletSave method, the portal.Items is empty?
Help!!!
aspx:
But I encountered two problems.
1)When PortletReSet mehtod executed, the Portal control's content does not change?
2)In PortletSave method, the portal.Items is empty?
Help!!!
aspx:
<ext:Portal ID="PortalMain" runat="server" Border="false" >
</ext:Portal>
<ext:Button runat="server" ID="BtnResetPorlet" Text="reset Width="70">
<DirectEvents>
<Click OnEvent="PortletReSet"></Click>
</DirectEvents>
</ext:Button>
<ext:Button runat="server" ID="BtnSavePortlet" Text="save" Width="70">
<DirectEvents>
<Click OnEvent="PortletSave"></Click>
</DirectEvents>
</ext:Button>
cs code: protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
BindPortelet("10");
}
}
private void BindPortelet(string columnIndex)
{
PortalMain.Items.Clear();
PortalColumn tempcolumn = new PortalColumn();
tempcolumn.ID = "column" + columnIndex ;
Portlet templet = new Portlet();
templet.ID = "p1";
templet.Title = "p1"
tempcolumn.Items.Add(templet);
PortalMain.Items.Add(tempcolumn);
PortalMain.DataBind();
PortalMain.DoLayout();
}
protected void PortletReSet (object sender, DirectEventArgs e)
{
BindPortelet("200");
}
// portal.Items is empty, count=0?
protected void PortletSave (object sender, DirectEventArgs e)
{
string ids = "";
foreach (Portal portal in ControlUtils.FindControls<Portal>(this.Page))
{
foreach (PortalColumn tempcolumn in portal.Items )
{
foreach (Portlet tempportlet in tempcolumn.Items)
{
ids += tempportlet.ID + ",";
}
}
}
}
Last edited by Daniil; Aug 19, 2013 at 7:55 AM.
Reason: [CLOSED]