I am using WebMenu as a contextmenu for ultrawebgrid cells. The contextmenu works fine if I place the webgrid and webmenu directly in the page. The problem starts when I am trying to create a usercontrol using webgrid and webmenu, contextmenuclick(right click on grid cell) gives me an error saying "Popup name not valid".
igmenu_showMenu("<%=this.MROContextMenu.ClientID %>",null,0,0);
Thanks
The reason this does not work for our WebMenu and also our WebTree controls is that the id registered on the client will have all underscores removed. This is a known issue and cannot be fixed due to the possibility of breaking too many legacy applications.
You can do as micvoiss suggested and handle the client side initialize events and store the generated ids in global javascript variables. You can also write a server side method that will remove all underscores from a string and use that method in your code rendering block. For example, my method on the server side would look something like this:
{
}
Then on the client side, I can get the correct ids by doing somethign like this (in reference to the script in the original post):
igmenu_showMenu("<%=getNavClientId(this.MROContextMenu.ClientID) %>",null,0,0);
Thanks for the information. Finally the webmenu works in the user control fine without changing any code.