Hi there
Does someone have know how to trap clicks on Links in the WPF WebBrowser Control?
I need to get the links target, when the link is clicked, before the Page is navigating.
Any inputs highly appreciated!
My solution in Code As proposed for simple Links this would be achieved with the following code:
private void webBrowser1_Navigating(object sender, NavigatingCancelEventArgs e)
{
//prefix must be lowercase (ssrs conforms to web-standards and makes things lowercase)
string myPrefix = "http://myPrefix";
//check if target starts with the prefix
if (e.Uri.AbsoluteUri.StartsWith(myPrefix))
{
//cancel Navigation
e.Cancel = true;
}
}
Thank you for hepling me out on this.