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

System.InvalidOperationException: <Menu xmlns=''> was not expected

8 Answers 314 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Gaurav
Top achievements
Rank 1
Gaurav asked on 01 Sep 2008, 01:01 PM
Hi,

We have created a server web control by inheriting from the RADContextMenu. It works well with all the required style sheets and features until we do a LoadContentFile(). The application crashes with the error:
System.InvalidOperationException: <Menu xmlns=''> was not expected

The same xml when used with RADContextMenu (without any inheritance) works fine and the menu is displayed as required.
Can you please suggest something that we might be missing here while inheriting from the menu?
We currently have almost nothing defined for our own menu, it uses everything exposed by the RADContextMenu.

Looking forward for your response.

Thanks.

8 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 02 Sep 2008, 06:08 AM
Hi Gaurav,

I have found the following forum link which discuss a similar error. Go through it and see if it helps to some extent.
Load Context Menu from File

Thanks
Shinu.


0
Gaurav
Top achievements
Rank 1
answered on 02 Sep 2008, 11:34 AM
Hi Shinu,

I checked this other link and it says that this is a known issue and there is a hotfix attached in that forum link. I downloaded it but there were some version related issues.
If this is actually an issue, is there an installer available with the fix in place for this.
We are currently using an older version of Telerik controls library and are in the process of evaluating this new library for ASP.NET AJAX. We plan to upgrade our whole application to use this new library.
Can you please provide a fix for this issue so that we can go ahead with our evaluation?
Thanks in advance.
Gaurav
0
Veselin Vasilev
Telerik team
answered on 04 Sep 2008, 12:19 PM
Hi Gaurav,

Please check this KB article:
(ID#936) LoadContentFile does not work with inherited RadMenu

Best wishes,
Veskoni
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ashwani Bhat
Top achievements
Rank 2
answered on 04 Sep 2008, 12:53 PM
Hi Veskoni,

Thanks for the reply.
I added the attribute as suggested in the article. Is there anything else that is required to be done to be able to use a wrapper class over the telerik RADContextMenu?

The reason I am asking this is because now i am getting a different error. The error that i get is a runtime error which says:
"Line: 2794
Error: Sys.InvalidOperationException: Type Telerik.Web.UI.Orientation has already been registered. The type maybe defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update."

If i remove the inherited control from the page it starts working properly. So, it seems like i am missing something else here.

The inherited control is nothing else except a wrapper over RADContextMenu right now. It just sets a couple of properties for menu. It is a ASP.NET Server Control that we have built over RADContextMenu.

Can you please suggest something else that might be missing here?

Thanks.
0
T. Tsonev
Telerik team
answered on 08 Sep 2008, 04:13 PM
Hi Saurabh,

Generally, there should not be any problem with inheriting RadContextMenu. The error you are receiving is most likely AJAX-related, but I could not quite reproduce it in test environment. Can you please send us a sample project or post the relevant code here? Thank you.

Greetings,
Tsvetomir Tsonev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ashwani Bhat
Top achievements
Rank 2
answered on 09 Sep 2008, 07:18 AM
Hi,

Thanks for the reply.
If you have tried it in your test environment, can you please try to use the inherited Context Menu and show it on the right click event on a grid row.

This is what i have been trying to do.
We have a grid and we need to show this inherited context menu when a user right clicks on any row. We are using an inherited grid from RADGrid and an inherited context menu from RADContextMenu.

If you are able to do so without any javascript errors being thrown, can you please share the code with me, so that i can find out what exactly i am missing here.
Because i keep getting the same error on page load, "this._getContextMenuElement().style is null or not an object.".

Thanks.
0
Ashwani Bhat
Top achievements
Rank 2
answered on 09 Sep 2008, 09:11 AM
Hi,

One more thing. I compared the source files for the pages, one using RADContextMenu as is and the other using the inherited Context Menu. There is a div that is created for the Context menu, something like:

<div class="RadMenu RadMenu_Worklist rmContextMenu RadMenu_Worklist_Context">
  <ul class="rmActive rmVertical rmGroup rmLevel1">

followed by different items of the menu.

This div is coming up for RADMenu but not for the inherited one, which is why the javascript method _getContextMenuElement returns null and hence style is not present for it.

Can you check in your test environment what happens to this div?

Thanks in advance.
0
T. Tsonev
Telerik team
answered on 12 Sep 2008, 08:11 AM
Hello Saurabh,

I have just put up a small project that attaches an inherited RadContextMenu to RadGrid. I do not get the JavaScript error in it. Can you please take a look at it and modify it, if possible, so it resembles more closely your scenario?

Best wishes,
Tsvetomir Tsonev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Menu
Asked by
Gaurav
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Gaurav
Top achievements
Rank 1
Veselin Vasilev
Telerik team
Ashwani Bhat
Top achievements
Rank 2
T. Tsonev
Telerik team
Share this question
or