|
Rank: Newbie Groups: Member
Joined: 9/11/2007 Posts: 8
|
Hi all,
I'm sorry for this newbie question.
I've just downloaded the trial version and I'm trying to programatically add a menu to a page but this menu is not showing.
Here is my code :
public class MenuControl : System.Web.UI.WebControls.WebControl, INamingContainer { protected override void OnInit(EventArgs e) { EO.Web.Menu menu = new EO.Web.Menu(); EO.Web.MenuItem studio = new EO.Web.MenuItem(); studio.Text.Html = "Studio"; menu.Items.Add(studio); Controls.Add(menu); } }
If I replace the Eo.Web stuff with the line below, it perfectly adds the literal control to the page
Controls.Add(new LiteralControl("OK"));
What am I missing ? Thanks in advance, Laurent.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi Laurent, We tried the same code and it did work here. What we did is to have an blank page, then put in a Panel, then create a MenuControl in Page_Load:
Code: C#
private void Page_Load(object sender, System.EventArgs e)
{
Panel1.Controls.Add(new MenuControl());
}
Can you try the same and see if it works for you? Also you might want to try to use a static menu and make sure it works first. Thanks
|
|
Rank: Newbie Groups: Member
Joined: 9/11/2007 Posts: 8
|
Hi,
I tried what you suggested but it's not working either.
Anyway the live demos are working fine on localhost so it must be something stupid I'm not setting up correctly for my own project.
I'll be trying to troubleshoot it because I really want to test your great product !
Thanks, Laurent.
|
|
Rank: Newbie Groups: Member
Joined: 9/11/2007 Posts: 8
|
I could have it work and it's really great. Thanks, Laurent.
|
|