Menu during postbackmode: System.Exception: No item found with ID "New".

This post has 1 reply

Not Ranked
Posts: 3
JaniOinonen Posted: Wed Feb 6, 2008 @ 7:48 AM
Web.UI version: 2007.2.1411.2
ASP.Net: 2.0

The menu is used as a dropdown menu for a toolbar. The page loads just fine. but when i click a button in the toolbar which raises a postback i get this error:

System.Exception: No item found with ID "New".

It's almost as if the menu cant find this in the xml file:

<Item>
<MenuItem Text="Ny" ID="New">
<MenuItem Text="Val 1" />
<MenuItem Text="Val 2" />
<MenuItem LookId="BreakItem" />
<MenuItem Text="Val 3" />
<MenuItem LookId="BreakItem" />
<MenuItem Text="Val 4">
<MenuItem Text="Val 4.1" />
<MenuItem Text="Val 4.2" />
<MenuItem Text="Val 4.3" Enabled="false" />
</MenuItem>
<MenuItem LookId="BreakItem" />
<MenuItem Text="Val 5" />
</MenuItem>
</Items>

The menu looks like this:

<ComponentArt:Menu id="TopToolBar_New"
ContextMenu="Custom"
DefaultDisabledItemLookId="DisabledItem"
DefaultGroupCssClass="TopMenuGroup"
DefaultGroupExpandOffsetX="+1"
DefaultGroupItemSpacing="1"
DefaultItemLookID="DefaultItemLook"
ExpandDisabledItems="false"
ImagesBaseUrl="~/Images/"
Orientation="Vertical"
OverlayWindowedElements="false"
HideSelectElements="false"
RenderRootItemId="New"
SiteMapXmlFile="~/Pages/UserControls/menu.xml"
TopGroupExpandDirection="BelowLeft"
TopGroupExpandOffsetX="0"
TopGroupExpandOffsetY="-3"
runat="server">
<ItemLooks>
<ComponentArt:ItemLook LookId="DefaultItemLook" CssClass="TopMenuItem" HoverCssClass="TopMenuItemHover" ExpandedCssClass="TopMenuItemHover" LeftIconWidth="16" LeftIconHeight="16" RightIconUrl="arrowblack.gif" RightIconVisibility="WhenExpandable" RightIconWidth="16" RightIconHeight="16" LabelPaddingLeft="16" LabelPaddingRight="10" LabelPaddingTop="3" LabelPaddingBottom="4" />
<ComponentArt:ItemLook LookId="DisabledItem" CssClass="TopMenuDisabledItem" HoverCssClass="TopMenuDisabledItemHover" LeftIconWidth="16" LeftIconHeight="16" RightIconUrl="arrowgrey.gif" RightIconVisibility="WhenExpandable" RightIconWidth="16" RightIconHeight="16" LabelPaddingLeft="16" LabelPaddingRight="10" LabelPaddingTop="3" LabelPaddingBottom="4" />
<ComponentArt:ItemLook LookId="BreakItem" CssClass="TopMenuBreak" HoverCssClass="TopMenuBreak" ActiveCssClass="TopMenuBreak" />
</ItemLooks>
</ComponentArt:Menu>

I dont understand why the menu doesnt work when the page is in postback mode. I have googled and looked through these forums but havent found any solution. At the moment i have nothing in my codebehind so i havent got any code there that might disturb.

Any form of help is highly appreciated. :)
Not Ranked
Posts: 3
JaniOinonen Posted: Wed Feb 6, 2008 @ 11:31 PM
I solved this problem. Viewstate had to be turned off for the menu.
Page 1 of 1 (2 items)