|
Rank: Member Groups: Member
Joined: 10/25/2012 Posts: 14
|
I have an aspx menu inside a callback panel and on loading the menu is automatically expanded. I would like to then use the eo web menu instead but cannot create it dynamically.
Please assist on the easiest way to create an instance this menu dynamically.
Thanks.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi, Dynamically creating a menu is exactly the same as dynamically creating any other ASP.NET server control. So we do not provide any support on that. You can try to get your code working with dynamically creating another standard control (such as asp:Button) and then switch it for our Menu. When you use CallbackPanel, make sure you create the control in early stage of the page's life cycle such as in Page_Init event. Alternatively, you can try to dynamically create menu item instead of the menu control. You can find a working example on how to dynamically modify a menu here: http://demo.essentialobjects.com/Demos/Menu/Programming/Server%20Side%20Programming/Dynamically%20Modifying%20Menu/Demo.aspxThe source code is already installed on your machine inside "Samples/Web" directory when you install the product. You can examine the source code to see how it works. Hope this helps. Please feel free to let us know if you still have any questions. Thanks!
|
|
Rank: Member Groups: Member
Joined: 10/25/2012 Posts: 14
|
Hi,
Sorry. I meant actually creating the menu dynamically. Problem is selecting a template menu dynamically. I know that this is not an issue with the control, but I would like to know how to do it. Especially setting up LookItems, ItemID (_TopLevelItem / seperator) etc.
Thank you in advance.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi,
The easiest way for you to do this is to put the Menu inside a UserControl and then dynamically creating that UserControl instead. This way whatever properties that you want to set you can set at design time in your ascx. This will save you a lot of code.
If you can not do it that way, you basically just have to write the code to set each and every one property you see in your .aspx/.ascx file.
Thanks!
|
|