Oct 13, 2011, 10:45 PM
StartMenu
Hi,
i have a problem,
i need to add new MenuItem to StartMenu dinamically from ad UserControl.
the code of my userControl
the load of userControl into aspx page
help please.
thank to all.
i have a problem,
i need to add new MenuItem to StartMenu dinamically from ad UserControl.
the code of my userControl
void Page_Load(object sender, EventArgs e)
{
initModule();
}
protected override void initModule()
{
createElementToMainMenu();
}
private void createElementToMainMenu()
{
Ext.Net.MenuItem rootItem = ((Ext.Net.MenuItem)getMainDesktop().FindControl(gapMenuElement.RootMenuItemId));
rootItem.Menu[0].Items.Add(gapMenuElement)
}
What's wrong?the load of userControl into aspx page
protected void Page_Load(object sender, EventArgs e)
{
string uCname = moduleXml.SelectSingleNode("uc-name").InnerText + ".ascx";
CustomModule gapUserControl = Page.LoadControl("modules_uc/" + uCname) as CustomModule;
gapUserControl.ID = uCname;
this.Controls.Add(gapUserControl);
string desktopModuleID = moduleXml.SelectSingleNode("window-id").InnerText;
Ext.Net.DesktopWindow dWind = this.FindControl(gapUserControl.ID).FindControl(desktopModuleID) as Ext.Net.DesktopWindow;
this.Controls.Add(dWind);
}
help please.
thank to all.