Menu problem with RenderRootID "No Item found with ID" during postback

Answered (Verified) This post has 1 verified answer and 3 replies

Not Ranked
Posts: 4
mattecginc Posted: Wed Feb 3, 2010 @ 9:34 AM
I have two menus in a user control that are sharing the same SiteMapXmlFile. I'm attempting to use the RenderRootItemId to show the submenu of what is selected in the first menu control. for both menus. It renders correctly on first load but on a postback I receive an error "No Item found with Id 'L2Reports'". Here is the html markup (nothing in code behind). I've tried version 2009.2 and 2009.3 with same results.

<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="Menu.ascx.vb" Inherits="RBC.Website.Menu2.Menu" %>
<%@ Register Assembly="ComponentArt.Web.UI" Namespace="ComponentArt.Web.UI" TagPrefix="ComponentArt" %>
<div>
    <ComponentArt:Menu ID="MenuLevel1" runat="server" RenderDrillDownDepth="1" DefaultItemLookId="Unselected" DefaultSelectedItemLookId="Selected" DefaultChildSelectedItemLookId="Selected" AutoPostBackOnSelect="true" SiteMapXmlFile="~/MenuN.xml">
    </ComponentArt:Menu>
</div>
<div>
    <ComponentArt:Menu ID="MenuLevel2" runat="server" RenderRootItemId="L2Reports"  RenderDrillDownDepth="1" DefaultItemLookId="Unselected" DefaultSelectedItemLookId="Selected" DefaultChildSelectedItemLookId="Selected" AutoPostBackOnSelect="true" SiteMapXmlFile="~/MenuN.xml">
    </ComponentArt:Menu>
</div>

<?xml version="1.0" encoding="utf-8" ?>
<SiteMap>
	<item Id="L2Reports" Text="Reports" Value="~/Reports/AlarmReport.ascx">
		<item Id="L3ReportsDeflection" Text="Deflection" Look-LeftIconUrl="menu-deflect.gif" Value="~/Reports/AlarmReport.ascx" >
			<item Id="Alarm" Text="Alarm" Look-LeftIconUrl="menu-alarm.gif" Value="~/Reports/AlarmReport.ascx" ></item>
			<item Id="Autozero" Text="Autozero" Look-LeftIconUrl="menu-autozero.gif" Value="~/Reports/AutoZero.ascx" ></item>
			<item Id="Startup" Text="Startup" Look-LeftIconUrl="menu-startup.gif" Value="~/Reports/StartUp.ascx" ></item>
			<item Id="Time" Text="Time" Look-LeftIconUrl="menu-time.gif" Value="~/Reports/Time.ascx" ></item>
			<item Id="Frequency" Text="Frequency" Look-LeftIconUrl="menu-freq.gif" Value="~/Reports/Frequency.ascx" ></item>
			<item Id="Shutdown" Text="Shutdown" Look-LeftIconUrl="menu-shutdown.gif" Value="~/Reports/StartUp.ascx" ></item>
			<item Id="Resultant" Text="Resultant" Look-LeftIconUrl="menu-resultant.gif" Value="~/Reports/ForceVectorReport.ascx" ></item>
			<item Id="Polar" Text="Polar" Look-LeftIconUrl="menu-polar.gif" Value="~/Reports/PolarReport.ascx" ></item>
			<item Id="XY" Text="X-Y" Look-LeftIconUrl="menu-xy.gif" Value="~/Reports/AmpsDeflectsReport.ascx" ></item>
			<item Id="Stats" Text="Stats" Look-LeftIconUrl="menu-stats.gif" Value="~/Reports/Stats.ascx" ></item>
			<item Id="Summary" Text="Summary" Look-LeftIconUrl="menu-summary.gif" Value="~/Reports/SummaryReport.ascx" ></item>
			<item Id="Health" Text="Health" Look-LeftIconUrl="menu-health.gif" Value="~/Reports/Health.ascx" ></item>
			<item Id="Maintenance" Text="Maintenance" Look-LeftIconUrl="menu-maint.gif" Value="~/Reports/MaintenanceReport.ascx" ></item>
		</item>
		<item Id="L3ReportsAccelerometers" Text="Accelerometers" Look-LeftIconUrl="menu-accel.gif" NavigateUrl="~/ReportAccelerometers.aspx" Value="~/Reports/TimeAccelReport.ascx" >
			<item id="u" Text="Deflection" Look-LeftIconUrl="menu-time.gif" NavigateUrl="~/ReportAccelerometers.aspx" Value="~/Reports/TimeAccelReport.ascx" ></item>
			<item id="v" Text="Frequency" Look-LeftIconUrl="menu-freq.gif" NavigateUrl="~/ReportAccelerometers.aspx" Value="~/Reports/FrequencyAccelReport.ascx"></item>
		</item>
	</item>
</SiteMap>

The stack trace:
[Exception: No item found with ID "L2Reports".]
  ComponentArt.Web.UI.Menu.GetStartGroupItems() +198
  ComponentArt.Web.UI.Menu.BuildStorage() +61
  ComponentArt.Web.UI.Menu.ComponentArtRender(HtmlTextWriter output) +1362
  ComponentArt.Web.UI.WebControl.Render(HtmlTextWriter output) +51
  System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27

Answered (Verified) Verified Answer

Top 10 Contributor
Posts: 1,454
Answered (Verified) harish Posted: Wed Feb 3, 2010 @ 10:17 AM
Verified by mattecginc

Hello,

 

Thank you for submitting your query with ComponentArt Forum.

 

In order to overcome this the Viewstate has to be turned off for the menu as follows:

 

 

 

<div>


<ComponentArt:Menu ID="MenuLevel2" runat="server" RenderRootItemId="L2Reports" RenderDrillDownDepth="2" DefaultItemLookId="Unselected" DefaultSelectedItemLookId="Selected" DefaultChildSelectedItemLookId="Selected" AutoPostBackOnSelect="true" SiteMapXmlFile="~/MenuN.xml" EnableViewState
="false">


</ComponentArt:Menu>

</div>

 

 

 

You may also refer the following forum link:

 

http://www.componentart.com/community/forums/p/38168/38168.aspx#38168

 

Thanks.

 

Harish Malhotra

All Replies

Top 10 Contributor
Posts: 1,454
Answered (Verified) harish Posted: Wed Feb 3, 2010 @ 10:17 AM
Verified by mattecginc

Hello,

 

Thank you for submitting your query with ComponentArt Forum.

 

In order to overcome this the Viewstate has to be turned off for the menu as follows:

 

 

 

<div>


<ComponentArt:Menu ID="MenuLevel2" runat="server" RenderRootItemId="L2Reports" RenderDrillDownDepth="2" DefaultItemLookId="Unselected" DefaultSelectedItemLookId="Selected" DefaultChildSelectedItemLookId="Selected" AutoPostBackOnSelect="true" SiteMapXmlFile="~/MenuN.xml" EnableViewState
="false">


</ComponentArt:Menu>

</div>

 

 

 

You may also refer the following forum link:

 

http://www.componentart.com/community/forums/p/38168/38168.aspx#38168

 

Thanks.

 

Harish Malhotra

Not Ranked
Posts: 4
mattecginc Posted: Wed Feb 3, 2010 @ 10:35 AM
I was hoping there was another solution or that I was simply doing somethng wrong. The only problem with this is that the menu loses it's state. It doesn't remember which item is selected during a page postback and wont show the right styles. The menu isn't using the navigate-url attribute either as everything is loaded on the same page (not my design). I was hoping for another solution. I suppose I can keep track of which item is selected in the usercontrol that is hosting the component art menus.

Thanks
Top 10 Contributor
Posts: 1,454
harish Posted: Wed Feb 3, 2010 @ 2:03 PM

Hello,

 

Thanks for getting back to me.

 

Regarding the Menu problem with RenderRootID "No Item found with ID" ; I have logged this behavior with our developers in our defect management system, with an defect ID of #D6771. This defect will be assigned to a developer to research for a fix, workaround, or other resolution.  If some other resolution is reached, I will contact you with this information.

 

Thank you for your co-operation and patience in this regard.

 

Harish Malhotra

Page 1 of 1 (4 items)