This is a migrated thread and some comments may be shown as answers.

LoadContentFile Error

6 Answers 107 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Craig
Top achievements
Rank 1
Craig asked on 20 Mar 2008, 05:55 PM
Hi all,

I am trying to load a content file into the menu using  LoadContentFile but keep getting an error. I downloaded the latest exe on the 19/032008 with the TelerikWeb.UI.dll version beeing 2007.3.1425.35.

I have succesfully got this working with the old controls so I know the method works but just cant get it to work with the new Prometheus menu control.

My code is as follows:

Menu Control:
<telerik:RadMenu ID="rmTopMenu" runat="server" Skin="Outlook"></telerik:RadMenu>

Code behind:
rmTopMenu.LoadContentFile("~/Auth/Common/Controls/Menus/Contents/DefaultMenu.xml");

XML Structure:
<?xml version="1.0" encoding="utf-8" ?>
<
Menu>
    <
Group Flow="Horizontal">
        <
Item Text="Item 1"></Item>
        <
Item Text="Item 2"></Item>
        <
Item Text="Item 3"></Item>
   </
Group>
</
Menu>


Error Message:
System.InvalidOperationException: <Group xmlns=''> was not expected.

Any ideas on this would be much appreciated.

Thanks

Craig

6 Answers, 1 is accepted

Sort by
0
Craig
Top achievements
Rank 1
answered on 20 Mar 2008, 06:09 PM
I think I found the problem in that my file was referencing the another xml file which had a group within an item and that groups item visible property was set to false.

Dont know if that is not allowed in Prometheus, worked in the old controls as used it to hide menu items from the drop down but used it to build a breadcrumb by looping through the menu items.

Cheers

Craig
0
Farhad Billimoria
Top achievements
Rank 1
answered on 11 Jul 2008, 03:24 PM
Can someone please help me, I get a similar error like this one...

<PanelItems xmlns=''> was not expected.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: <PanelItems xmlns=''> was not expected.

Source Error:

Line 4:  
Line 5:      Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Line 6: Me.radNavigation.LoadContentFile("~/Navigation.xml")

_____________________________
here is the code...

Protected

Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    Me.radNavigation.LoadContentFile("~/Navigation.xml")

End Sub



Here is my XML file Navigation.xml

<?

xml version="1.0" encoding="utf-8" ?>

<

PanelItems>

<

PanelItem Value="mnuProData" Text="Process Data" Expanded="True" runat="server">

<

PanelItem Value="mnuProData1" Text="Upload Data" Target="mainFrame" runat="server" NavigateUrl="UploadData.aspx"></PanelItem>

<

PanelItem Value="mnuProData2" Text="Review Data" Target="mainFrame" runat="server" NavigateUrl="ModifyData.aspx"></PanelItem>

</

PanelItem>

<

PanelItem Value="mnuProcAct" Text="Processing Activities" runat="server">

<

PanelItem Value="mnuProcAct1" Text="Processing Activities" Target="mainFrame" runat="server" NavigateUrl="ViewTotals.aspx"></PanelItem>

<

PanelItem Value="mnuProcAct2" Text="Processing Activities" Target="mainFrame" runat="server" NavigateUrl="GenerateElections.aspx"></PanelItem>

</

PanelItem>

<

PanelItem Value="mnuReports" Text="Reports" runat="server">

<

PanelItem Value="mnuReports1" Text="Merit Reports" Target="mainFrame" runat="server" NavigateUrl="MCReportViewer.aspx?rep=merit"></PanelItem>

<!--

<PanelItem Value="mnuReports2" Text="District Totals" Target="mainFrame" runat="server" NavigateUrl="DCReportViewer.aspx?rep=disttotals"></PanelItem>-->

</

PanelItem>

<!--

<PanelItem Value="mnuMHelp" Text="Help" runat="server">

<PanelItem Value="mnuContents" Text="Contents" Target="webHelp" runat="server"></PanelItem>

<PanelItem Value="mnuSupport" Text="Support" Target="mainFrame" runat="server"></PanelItem>

<PanelItem Value="mnuFeedback" Text="Feedback" Target="mainFrame" runat="server"></PanelItem>

</PanelItem>

<PanelItem Value="mnuAdministration" Text="Administration" runat="server">

<PanelItem Value="mnuSendEMail" Text="Send EMail" NavigateUrl="SendEMail.aspx" Target="mainFrame" runat="server"></PanelItem>

<PanelItem Value="mnuUserAdmin" Text="Add/Modify Users" NavigateUrl="UserAdmin.aspx" Target="mainFrame" runat="server"></PanelItem>

<PanelItem Value="mnuFHLBankAdmin" Text="Modify Entity" NavigateUrl="FHLBankAdmin.aspx" Target="mainFrame" runat="server"></PanelItem>

<PanelItem Value="mnuApplicationSettings" Text="Application Settings" NavigateUrl="AppSettings.aspx" Target="mainFrame" runat="server"></PanelItem>

</PanelItem>

-->

</

PanelItems>

0
Veselin Vasilev
Telerik team
answered on 11 Jul 2008, 03:29 PM
Hello Farhad Billimoria,

Please make sure that the XML file conforms to the structure described in this help topic:
RadPanelBar Items > Loading Items from XML

Best wishes,
Veskoni
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Farhad Billimoria
Top achievements
Rank 1
answered on 11 Jul 2008, 04:23 PM
thanks ! got it.
0
Steve
Top achievements
Rank 1
answered on 24 May 2011, 06:43 PM
This link seems to be broken.  Can you post a valid link or update this one?
0
Helen
Telerik team
answered on 26 May 2011, 09:40 AM
Hello Steve,

Please find below the updated link:
Loading Items from XML

Regards,
Helen
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Menu
Asked by
Craig
Top achievements
Rank 1
Answers by
Craig
Top achievements
Rank 1
Farhad Billimoria
Top achievements
Rank 1
Veselin Vasilev
Telerik team
Steve
Top achievements
Rank 1
Helen
Telerik team
Share this question
or