I have a WPF WebBrowser control which I used in my wpf client application to navigate to different pages. It has basic functionalities like back , forward , go events which calls this.webbrowser.goback(), this.webbrowser.goforward(), this.webbrowser.go().
Though the web application works fine with IE which means all the forward and back navigations for more than one level .More than one level navigation doesn't work fine in my WPF application for one page(Billings which has contacts link and in contacts page we have address link.) when clicking back button on my address page it goes to contacts page but clicking back button on contacts page doesn't go to billing page.
Since it's working fine in IE without any issues I suspect there is something wrong with my WPF applications . I have few questions here .
- Is the webbrowser.goback() same as click back button of IE ? Or any events will be missed out in the wpf webbrowser control compared to IE ?
- IS there a way we can debug the javasctipts from WPF application itself ?
- Is there a better way to debug these kind of scenarios from WPF applications ?
- Does IE stores the WPF WebBrowser navigations in its history or it is a separate instance ?
my control looks like below
<WebBrowser x:Name="webBrowser" DockPanel.Dock="Bottom" Navigating="webBrowser_Navigating" Navigated="webBrowser_Navigated" LoadCompleted="webBrowser_LoadCompleted"/>
And code behind looks like below:
private void backButton_Click(object sender, RoutedEventArgs e)
{
// Navigate to the previous HTML document, if there is one
if (this.webBrowser.CanGoBack)
{
this.webBrowser.GoBack();
}
else
{
MessageBox.Show("Cannot go back. There needs to be something in the history to go back to.");
}
}
private void forwardButton_Click(object sender, RoutedEventArgs e)
{
// Navigate to the next HTML document, if there is one
if (this.webBrowser.CanGoForward)
{
this.webBrowser.GoForward();
}
else
{
MessageBox.Show("Cannot go Forward. There needs to be something in the history to go forward to.");
}
}