views:

850

answers:

1

I'm running google earth in a web browser that is embedded in a c# app. I have captured an event through javascript that fires when the user right clicks on the globe. How can I bubble an event to go from the javascript to c# so that it can be handled there?

Thanks

+1  A: 

To raise an event from Javascript, you need to follow these steps:

1) Create a hidden asp:button in your aspx page.
2) write the following JS code in aspx file:
     var btnHidden = document.getElementById(HiddenButtonClientId);
       if (btnHidden) { btnHidden.click(); }

Now, your button click event will be fired and you can write desirable code there.