Problems using the ModulesMenu of the Reference Implementation of WSSF

Topics: Web Client Software Factory, User Forum
Jul 20, 2007 at 3:26 PM
I used the RI as a basis for my site. Now I have the following problem using the ModulesMenu located in the MasterPage:

the first time I load a page (that use that MasterPage) clicking on the left side ActionsMenu, the orizzontal header ModulesMenu is rightly displayed ...
BUT at the first postBack the images of the ModulesMenu disappear and only the moduleName is displayed. I need to call the page again using the ActionsMenu to have the ModulesMenu again displayed correctly with the images.
Looking to the source code generated, I see that all the code related to the images of the ModulesMenu is not present anymore in the postbacked page ( as if <%# ((MenuItem)Container.DataItem).ImageUrl %> was found null and all that part of code not taken in account).

I miss something? Could be because the postBack is done by a component located in a User Control (I used the method suggested in wcsfcontrib to support the dependency injection on User Controls and Master Pages)? Any suggestion how to resolve this problem?

In the following you can found the aspx code (the same of RI) used for the ModuleMenu and the souce code of the page looked at the first access to the page (everything rightly displayed) and then at the first postBack (no images anymore and only moduleName displayed!!)

aspx code:

<asp:Menu SkinID="modulesMenu" DataSourceID="modulesSource" runat="server" ID="ModulesMenu" OnMenuItemDataBound="ModulesMenu_MenuItemDataBound">
<StaticItemTemplate>
<asp:HyperLink CssClass="moduleImage" NavigateUrl='<%# ((MenuItem)Container.DataItem).NavigateUrl %>'
ImageUrl='<%# ((MenuItem)Container.DataItem).ImageUrl %>' runat="server" /><br />
<asp:HyperLink CssClass="moduleName" NavigateUrl='<%# ((MenuItem)Container.DataItem).NavigateUrl %>'
Text='<%# ((MenuItem)Container.DataItem).Text %>' runat="server" />
</StaticItemTemplate>



<asp:Menu SkinID="modulesMenu" DataSourceID="modulesSource" runat="server" ID="ModulesMenu" OnMenuItemDataBound="ModulesMenu_MenuItemDataBound">
<StaticItemTemplate>
<asp:HyperLink CssClass="moduleImage" NavigateUrl='<%# ((MenuItem)Container.DataItem).NavigateUrl %>'
ImageUrl='<%# ((MenuItem)Container.DataItem).ImageUrl %>' runat="server" /><br />
<asp:HyperLink CssClass="moduleName" NavigateUrl='<%# ((MenuItem)Container.DataItem).NavigateUrl %>'
Text='<%# ((MenuItem)Container.DataItem).Text %>' runat="server" />
</StaticItemTemplate>



Soucecode of the page the first time (ModuleMenu correct ly displayed):

<td onmouseover="MenuHoverStatic(this)" onmouseout="MenuUnhover(this)" onkeyup="MenuKey(this)" title="Modulo di Amministrazione" id="ctl00ModulesMenun2">
<table class="moduleMenuItem ctl00ModulesMenu4" cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td style="white-space:nowrap;"><a class="ctl00ModulesMenu1 moduleMenuItem ctl00ModulesMenu3" href="../Amministrazione/Default.aspx" style="border-style:none;font-size:1em;">
<a class="moduleImage" href="../Amministrazione/Default.aspx"><img src="../App_Themes/Default/Images/adminInactive.png" style="border-width:0px;" /></a><br />
<a class="moduleName" href="../Amministrazione/Default.aspx">Amministrazione</a>
</a></td>
</tr>
</table>
.....


Soucecode of the page after a postback (ModuleMenu displayed without images):

<td onmouseover="MenuHoverStatic(this)" onmouseout="MenuUnhover(this)" onkeyup="MenuKey(this)" title="Modulo di Amministrazione" id="ctl00ModulesMenun2">
<table class="moduleMenuItem ctl00ModulesMenu4" cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td style="white-space:nowrap;"><a class="ctl00ModulesMenu1 moduleMenuItem ctl00ModulesMenu3" href="../Amministrazione/Default.aspx" style="border-style:none;font-size:1em;">Amministrazione</a>
</td>
</tr>
</table>
</td>