Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
504
ContextMenu does not open on any control when ASPX page is under Master page
posted

Hi,

I am getting this weired error everytime when i try to get the context menu open.

Here is my Scenario

1. Usercontrol with Menu and Webtree

2. User Control in a Page which is under Master Page

3. Menu has following Client and ASPX code

 

 

 

 

 

 

 

 

 

 

//Global Variable to store the menu name

 

 

var menuInstance;

 

 

 

 

 

function initMenu(menuId)

{

menuInstance = igmenu_getMenuById(menuId);

}

.........

<ignav:UltraWebMenu...

MenuClientSideEvents InitializeMenu="initMenu"......./>

="initMenu"

</<ignav:UltraWebMenu>

Tree has following code

=================

 

function ubtDataTree_NodeClick(treeId, nodeId, button)

{

 

//Context Menu Clik

 

if(button == 2)

{

 

var tree = igtree_getTreeById(treeId);

igmenu_showMenu(menuInstance, tree.event);

}

}

 <ignav:UltraWebTree....>

<

ClientSideEvents NodeClick="ubtDataTree_NodeClick"/>

 

</ignav:UltraWebTree>

Now i even tried with <%=UltrawebMenu1.ClientID %>

What could be th error?

Parents
No Data
Reply
  • 28407
    posted

    HI,

      I go the menu_id from the contextmenu's init event. I stored it in a javascrpt global variable.

    Here is my user control - UltraWebMenu2 is my context menu. - I tested it and it  worked.

    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="WebUserControl" %>
    <%@ Register assembly="Infragistics2.WebUI.UltraWebNavigator.v8.3, Version=8.3.20083.1009, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.UltraWebNavigator" tagprefix="ignav" %>

    <script type="text/javascript" id="igClientScript">
    <!--

    <!--

    <!--

    function UltraWebTree1_NodeClick(treeId, nodeId, button){
     //Add code to handle your event here.
    // var menu2 = <%= UltraWebMenu2.ClientID%>
    //debugger;
    // igmenu_showMenu(<%= UltraWebMenu2.ClientID.Replace("_","")%>)
       igmenu_showMenu(menu2); 
    }
    // -->

    function UltraWebTree1_InitializeTree(treeId){
     //Add code to handle your event here.
    }
    // -->
    var menu2 = null;
    function UltraWebMenu2_InitializeMenu(menuId){
     //Add code to handle your event here.
      menu2 = menuId;
     
    }
    // -->
    </script>
    <ignav:UltraWebMenu ID="UltraWebMenu1" runat="server" JavaScriptFilename=""
        JavaScriptFileNameCommon="">
        <IslandStyle BackColor="LightGray" BorderStyle="Outset" BorderWidth="1px"
            Cursor="Default">
        </IslandStyle>
        <HoverItemStyle BackColor="DarkBlue" Cursor="Default" ForeColor="White">
        </HoverItemStyle>
        <Images>
            <SubMenuImage Url="ig_menuTri.gif" />
        </Images>
        <ItemStyle Cursor="Default" />
        <Items>
            <ignav:Item Text="Top Item">
                <Items>
                    <ignav:Item Text="Sub Menu Item">
                    </ignav:Item>
                    <ignav:Item Text="Sub Menu Item">
                    </ignav:Item>
                    <ignav:Item Text="Sub Menu Item">
                    </ignav:Item>
                    <ignav:Item Text="Sub Menu Item">
                    </ignav:Item>
                </Items>
            </ignav:Item>
            <ignav:Item Text="Top Item">
                <Items>
                    <ignav:Item Text="Sub Menu Item">
                    </ignav:Item>
                    <ignav:Item Text="Sub Menu Item">
                    </ignav:Item>
                    <ignav:Item Text="Sub Menu Item">
                    </ignav:Item>
                </Items>
            </ignav:Item>
            <ignav:Item Text="Top Item">
                <Items>
                    <ignav:Item Text="Sub Menu Item">
                    </ignav:Item>
                    <ignav:Item Text="Sub Menu Item">
                    </ignav:Item>
                </Items>
            </ignav:Item>
        </Items>
        <DisabledStyle Font-Names="MS Sans Serif" Font-Size="8pt" ForeColor="Gray">
        </DisabledStyle>
        <Levels>
            <ignav:Level Index="0" />
        </Levels>
        <SeparatorStyle BackgroundImage="ig_menuSep.gif" CssClass="SeparatorClass"
            CustomRules="background-repeat:repeat-x; " />
    <ExpandEffects ShadowColor="LightGray"></ExpandEffects>

    <MenuClientSideEvents InitializeMenu="" ItemChecked="" ItemClick="" SubMenuDisplay="" ItemHover=""></MenuClientSideEvents>
    </ignav:UltraWebMenu>
    <ignav:UltraWebTree ID="UltraWebTree1" runat="server" DefaultImage=""
        HiliteClass="" HoverClass="" Indentation="20" >
        <ClientSideEvents NodeClick="UltraWebTree1_NodeClick"
            InitializeTree="UltraWebTree1_InitializeTree" />
        <Levels>
            <ignav:Level Index="0" />
        </Levels>
        <Nodes>
            <ignav:Node Text="Root Node">
                <Nodes>
                    <ignav:Node Text="Child Node">
                    </ignav:Node>
                    <ignav:Node Text="Child Node">
                    </ignav:Node>
                    <ignav:Node Text="Child Node">
                    </ignav:Node>
                    <ignav:Node Text="Child Node">
                    </ignav:Node>
                </Nodes>
            </ignav:Node>
            <ignav:Node Text="Root Node">
                <Nodes>
                    <ignav:Node Text="Child Node">
                    </ignav:Node>
                    <ignav:Node Text="Child Node">
                    </ignav:Node>
                    <ignav:Node Text="Child Node">
                    </ignav:Node>
                    <ignav:Node Text="Child Node">
                    </ignav:Node>
                </Nodes>
            </ignav:Node>
            <ignav:Node Text="Root Node">
                <Nodes>
                    <ignav:Node Text="Child Node">
                    </ignav:Node>
                    <ignav:Node Text="Child Node">
                    </ignav:Node>
                    <ignav:Node Text="Child Node">
                    </ignav:Node>
                </Nodes>
            </ignav:Node>
        </Nodes>
    </ignav:UltraWebTree>
    <ignav:UltraWebMenu ID="UltraWebMenu2" runat="server" JavaScriptFilename=""
        JavaScriptFileNameCommon="" WebMenuTarget="PopupMenu" TargetFrame=""
        TargetUrl="">
        <IslandStyle BackColor="LightGray" BorderStyle="Outset" BorderWidth="1px"
            Cursor="Default">
        </IslandStyle>
        <HoverItemStyle BackColor="DarkBlue" Cursor="Default" ForeColor="White">
        </HoverItemStyle>
        <Images>
            <SubMenuImage Url="ig_menuTri.gif" />
        </Images>
        <ItemStyle Cursor="Default" />
        <Items>
            <ignav:Item Text="Top Item">
            </ignav:Item>
            <ignav:Item Text="Top Item">
            </ignav:Item>
            <ignav:Item Text="Top Item">
            </ignav:Item>
            <ignav:Item Text="Top Item">
            </ignav:Item>
            <ignav:Item Text="Top Item">
            </ignav:Item>
        </Items>
        <DisabledStyle Font-Names="MS Sans Serif" Font-Size="8pt" ForeColor="Gray">
        </DisabledStyle>
        <Levels>
            <ignav:Level Index="0" />
        </Levels>
        <SeparatorStyle BackgroundImage="ig_menuSep.gif" CssClass="SeparatorClass"
            CustomRules="background-repeat:repeat-x; " />
    <ExpandEffects ShadowColor="LightGray"></ExpandEffects>

    <MenuClientSideEvents InitializeMenu="UltraWebMenu2_InitializeMenu" ItemChecked=""
            ItemClick="" SubMenuDisplay="" ItemHover=""></MenuClientSideEvents>
    </ignav:UltraWebMenu>

     

     

Children
No Data