|
Rank: Member Groups: Member
Joined: 4/30/2008 Posts: 21
|
I have a menu that is in a Master Page (ASP.NET 2.0). A content page has a submit button. When I click the Submit button I want to add an item to the menu.
I add the menu item as described in the documentation but the menu item does not show up. Is there something special ou have to do in order to add menu items dynamically on the server?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Hi, You won't be able to do that without calling into your master page. And this is true for any control. ASP.NET keeps each object inside its coding unit so that different coding units are separated and less error prone. Details about calling into your master page are beyond the scope of our support, but you may find the following MS article helpful: http://msdn.microsoft.com/en-us/library/c8y19k6h.aspx Thanks
|
|
Rank: Member Groups: Member
Joined: 4/30/2008 Posts: 21
|
I am aware of this. This is how I add the menu item to begin with. The prblem is that even though I add the item, it does not appear in the menu.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Hi,
Sorry for having missed the point in the previous reply....There should be no difference if you already have a reference to the menu though. Can you try the same code with a page without master page and see if it works?
Thanks
|
|
Rank: Member Groups: Member
Joined: 4/30/2008 Posts: 21
|
Same problem without the MasterPage
|
|
Rank: Member Groups: Member
Joined: 4/30/2008 Posts: 21
|
Ok, I figured out what the problem was and the only reason I'm posting it is because it could happen to someone else. This was a stupid mistake on my part.
When I was trying to add items to another menu item, I was forgetting about menu items that are separators. So, I was referencing the wrong menu item and since separators do not have sub-menus, i could not see the newly "added" menu item.
Perhaps in a future release of EO, you could have the menu throw an error if you try to add a menu item to a separator.
Thanks for your help.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
It makes perfect sense. We will see if we can add the code to throw out a message when adding a menu item to a separator. Thanks for sharing!
|
|