Sub Menu item lost on post back

This post has 6 replies

Not Ranked
Posts: 10
markl Posted: Mon Jul 16, 2007 @ 3:16 PM
I have the folloowing code which has one top level menu item and 1 menu item underneath. When i post back i can no longer see the sub menu item (export to word). Anybody got any ideas?

<ComponentArt:Menu ID="ActionMenu" runat="server" EnableViewState="true">
<ItemLooks>
<ComponentArt:ItemLook LookId="RootLook" />
<ComponentArt:ItemLook LookId="WordLook" LeftIconUrl="~/images/fileIconWord_vsmall.gif" />
<ComponentArt:ItemLook LookId="EmailLook" LeftIconUrl="~/images/email.gif" />
<ComponentArt:ItemLook LookId="PrintLook" LeftIconUrl="~/images/print.gif" />
</ItemLooks>
<Items>
<ComponentArt:MenuItem ID="menuExport" Text="Actions" LookId="RootLook" AutoPostBackOnSelect="false">
<ComponentArt:MenuItem ID="menuWord" Text="Export To Word" LookId="WordLook" AutoPostBackOnSelect="True">
</ComponentArt:MenuItem>
</ComponentArt:MenuItem>
</Items>
</ComponentArt:Menu>
Top 25 Contributor
Posts: 336
sadat Posted: Wed Jul 18, 2007 @ 1:45 PM
Try calling ActionMenu.ReloadTemplates() after the postback.
Not Ranked
Posts: 10
markl Posted: Wed Jul 18, 2007 @ 4:52 PM
I put the above code in but still no menu items are shoing after a postback. Code below... runs in page_load

if (!Page.IsPostBack )
{
LoadProject();
LoadDynamicTabs();
btnSubmit.Attributes.Add("onclick","return DisplaySubmitWarning();");
}
else
{
ActionMenu.ReloadTemplates();
}
Not Ranked
Posts: 10
markl Posted: Wed Jul 18, 2007 @ 4:57 PM
Got it!

I had smartnavigation="true" in my aspx. I changed to
MaintainScrollPositionOnPostback="true" and the menu items turned up.
Not Ranked
Posts: 8
compumaster Posted: Fri Aug 31, 2007 @ 10:36 AM
Hi Sadat,

This doesn't work for me, too :(
Have you got anything other for us to do?

Thanks
Jochen
Not Ranked
Posts: 8
compumaster Posted: Fri Aug 31, 2007 @ 10:38 AM
Hi Markl!

Where did you set up that property MaintainScrollPositionOnPostback?
I haven't found a property with this name in the whole Web.UI assembly.

Thanks
Jochen
Top 25 Contributor
Posts: 336
sadat Posted: Fri Aug 31, 2007 @ 1:20 PM
Do you have Smart Navigation enabled in your website?
Try setting it to false.
Page 1 of 1 (7 items)