Jun 09, 2010, 3:28 PM
[CLOSED] [1.0] - MVC - ViewData binding to Portlet Visible not working
Hi,
I am trying to hide a Portlet base on security. So, I have ViewData["isVisible"] = false, and when databind it to the Visible property for a Portlet, the page throw exception (error from FireBug is "invalid object initializer". But if I set the ViewData["isVisible"] = true, it works fine.
View Code
I am trying to hide a Portlet base on security. So, I have ViewData["isVisible"] = false, and when databind it to the Visible property for a Portlet, the page throw exception (error from FireBug is "invalid object initializer". But if I set the ViewData["isVisible"] = true, it works fine.
View Code
<ext:Portal ID="Portal2" runat="server" Border="false" Layout="Column">
<Items>
<ext:PortalColumn ID="PortalColumn3" runat="server" StyleSpec="padding:5px 5px 0px 5px" ColumnWidth=".5" Layout="Anchor" AutoScroll="true">
<Items>
<ext:Portlet ID="Portlet1" runat="server" Height="512" BodyStyle="padding:0px 0px 0px 0px" Visible='<%# ViewData["RoleTradeSummaryRead"] %>' AutoDataBind="true">
</ext:Portlet>
</Items>
</ext:PortalColumn>
</Items>
</ext:Portal>
Controller Codepublic ActionResult Dashboard()
{
ViewData["isVisible"] = false;
return this.View();
}
Thanks.