views:

18

answers:

1

Is there a way to fire an event when the user clicks on link on a web page. I looked at all the events available for the webbrowser control and the only one I saw was the LoadCompleted event. But this event fires after a page has been loaded. I need to fire an event right before a page is loaded.

A: 

Without some co-operating javascript in the web page there is no way to acheive this.

If the web page(s) being displayed are something you control you can add some javascript to the page like this:-

 window.external.notify("Page is doing xyz");

you can then use the controls ScriptNotify event to retrieve the string sent by the notify.

You could add such script in the web page onunload event or the onclick event of an anchor, etc.

AnthonyWJones
OK,Thanks for the info.
Weston Goodwin