I have a context menu that execute client side code only. [I have taken out the DIVs as they messed up the code when posting].
function gMapHybrid() { Map1.SetCurrentBackgroundMapType(G_HYBRID_MAP); return false; } ContextMenuItem contextMenuViewHybrid = new ContextMenuItem(" onclick=JavaScript:gMapHybrid();>Hybrid");
Once the client side function executes the context menu remains on screen. Is there a way to remove the popup memu after t the function has completed without a postback.
We have provided one client-side function named “HideContextMenus” to remove the DOM related with ContextMenu. Please refer to the attached sample project. Also we have provided two methods to register click event handler for MenuItem in the codes.
Can you debug and step into the HideContextMenus function? It’s defined in the helper_GeoResource.axd file.
In fact, it was used by internal methods. Also you can check the CurrentContextMenu object that represents the current displayed context menu on the map, and it owns a display method which controls the showing or hiding of the related context menu.