[quote="rawaho"]Hello,
this.Controls.Add(mTest);
What is
this? Is it page or usercontrol?
If page, then it could cause javascript problems.
Otherwise your sample is ok.
Here is what I have completely ok:
[code]
<%@ Register Assembly="NineRays.WebControls.FlyTreeView" Namespace="NineRays.WebControls"
TagPrefix="NineRays" %>
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
FlyContextMenu myMenu = new FlyContextMenu();
myMenu.ID = "myMenu";
FlyMenuItem menuItem = new FlyMenuItem("click me", "mycommand");
menuItem.AutoPostBack = true;
myMenu.Items.Add(menuItem);
myMenu.Command += new FlyContextMenuCommandEventHandler(myMenu_Command);
panel.Controls.Add(myMenu);
}
void myMenu_Command(object sender, FlyContextMenuCommandEventArgs e)
{
throw new Exception("The method or operation is not implemented.");
}
Untitled Page
[/code]