Apr 21, 2015, 8:08 AM
[CLOSED] how direct click event call from (master page) code behind page on clicking menu (which is created dynamically)
we have a main master page and a nested master page on which we have create dynamic menu but when i am not able to call directs methods Or listeners from code behind...
and here id my nested master page code on which i am creating menu dynamically
public void GetLeftMenu(DataRow[] drMenu)
{
for (int i = 0; i < drMenu.Length; i++)
{
//Ext.Net.Button b1 = new Ext.Net.Button();
//b1.ID = "btn" + i.ToString();
//b1.Text = drMenu[i]["MENUNAME"].ToString();
//b1.Listeners.Click.Handler = "Ext.net.DirectMethods.LogCompanyInfo();";
//menupanel.Items.Add(b1);
Ext.Net.MenuItem menu = new Ext.Net.MenuItem();
menu.ID = drMenu[i]["PK_MENUID"].ToString();
menu.Text = drMenu[i]["MENUNAME"].ToString();
menu.DirectEvents.Click.Event += Click_Event;
MenuPanel1.Menu.Items.Add(menu);
}
}
[DirectMethod]
public static void Click_Event(object sender, DirectEventArgs e)
{
X.Msg.Alert("sssss", "ok ---").Show();
}
and here id my nested master page code on which i am creating menu dynamically
<asp:Content ID="Content2" ContentPlaceHolderID="pageContent" runat="server">
<div style="width:20%;float:left;">
<ext:Panel runat="server"
ID="pnlSetup"
Title="Setup"
Width="250"
Layout="HBoxLayout"
MarginSpec="72 0 0 0">
<Items>
<ext:Panel runat="server"
ID="menupanel"
Title="Meunusss"
Border="true"
AutoScroll="true"
Height="500"
Width="250"
Layout="FitLayout">
<Items>
<ext:MenuPanel
ID="MenuPanel1"
runat="server"
Region="West">
<Menu ID="Menu1" runat="server">
<Items>
</Items>
</Menu>
</ext:MenuPanel>
</Items>
</ext:Panel>
</Items>
</ext:Panel>
</div>
<div style="width:80%;float:left;margin-top:144px;">
<asp:ContentPlaceHolder ID="childContentph1" runat="server">
sdfgsdfgsd
</asp:ContentPlaceHolder>
</div>
<div>
<asp:ContentPlaceHolder ID="childContentph2" runat="server">
</asp:ContentPlaceHolder>
</div>
</asp:Content>
Last edited by Daniil; May 05, 2015 at 3:42 PM.
Reason: [CLOSED]