I have a webbrowser control in C # .NET CF.
When a user clicks on a hyperlink, instead of trying to go to the specified URL, how would instead display a fragment of the html content stored in memory?
I tried the following
private void webBrowser_Navigating(object sender, WebBrowserNavigatingEventArgs e)
{
if (e.Url.Host != String.Empty) {
e.Cancel = true;
webBrowser.DocumentText = "<html> some text </html>";
}
}
private void webBrowser_Navigating(object sender, WebBrowserNavigatingEventArgs e)
{
if (e.Url.Host != String.Empty) {
webBrowser.DocumentText = "<html> some text </html>";
}
}
source
share