Home - Forums-.NET - FlyTreeView (ASP.NET) - Context menu behaviour, shows menu items of anothr one

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

This forum related to following products: FlyTreeView for ASP.NET

Context menu behaviour, shows menu items of anothr one
Link Posted: 15-Mar-2007 03:51
Hi,
I'm currently evaluating whether FlyTreeView for ASP .NET 2.0 suits our needs in a project.
System-Setup: Sharepoint Server 2007, Sharepoint-pages, Webpart with FlyTreeView and a dropdownlist for selecting different source-data, data from a database.
The issue is, that the context menu behaves weird - they show the correct menu, but with the content of another menu!

On initial load, everything is fine. The tree loads, on demand the nodes are populated further, the (one) context menu is fine. On selecting another entry in the dropdownlist, the page posts back, tree gets cleared, two new context menus are created, tree is loaded with nodes, again.
The menus even have different menu-IDs, different item text, but the same total number of items and some items point to the same javascript to be called as the previous menu items. The previous menu is NOT recreated.
- debug-information shows, that the correct menu-IDs are used, as well as the correct menu items with the correct data are created
- tree loads, debug-information shows, that the nodes point to the correct menu-ids
- right-clicking on the tree shows the wrong menu
--> reason: HTML contains a table with the correct menu, but the wrong text-entries in the div-elements
- clearing browser cache makes no difference
- Which ever menu is created at initially loading the page \"survives\", the context menu items of this menu show up in the other one
- HTML does not show the menu-id of the first menu - seems to work as designed.
I have used a whole day on checking whether my source code or source data are wrong, but according to the debug-info everything is fine.

Do you have an idea why it behaves like that - and probably a solution?
Regards,
rawaho

P.S.: We have not yet bought a license. I fully understand if you don't support for that reason, just drop me a notice.
Link Posted: 15-Mar-2007 09:00
Rawaho,

We're definitely interested in what is the reason of such behavior.
Your page displays HTML that is not present in source code of generated page. This is quite strange.

Could you please create and send a small example that is disconnected from your environment (can be run independently), but still raising some misbehavior.

This is the best way for us to debug the code and fix the issue (if any).
If possible, send it to flytreeview.asp[-at-]9rays.net

Thank you in advance.
Link Posted: 16-Mar-2007 00:42
Hi,
many thanks for your support. I've found a workaround:
just create all the menus you might need at the initial run - then everything is fine!
Best regards,
rawaho
Link Posted: 16-Mar-2007 04:45
Yes, finally we found the problem.
The Control.Controls.Add() method makes ASP.NET to start catch-up and restore state of FlyContextMenu control even if it has different ID.

The workaround for the issue is to add controls at OnInit or OnLoad stage. Or set new FlyContextMenu settings (add menuitems) after Controls.Add() call.

We also scheduled to clean up FlyContextMenu viewstate save/load implementation to make it free of such kind of dependencies.