Welcome Guest Search | Active Topics | Sign In | Register

Adding Menu Items Server Side Options
Shawn
Posted: Wednesday, April 30, 2008 4:46:01 PM
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?
eo_support
Posted: Wednesday, April 30, 2008 4:56:48 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
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
Shawn
Posted: Wednesday, April 30, 2008 5:11:52 PM
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.
eo_support
Posted: Wednesday, April 30, 2008 5:17:06 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
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
Shawn
Posted: Wednesday, April 30, 2008 6:42:36 PM
Rank: Member
Groups: Member

Joined: 4/30/2008
Posts: 21
Same problem without the MasterPage
Shawn
Posted: Wednesday, April 30, 2008 7:10:19 PM
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.
eo_support
Posted: Wednesday, April 30, 2008 7:16:56 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
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!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.