Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / December 2004

Tip: Looking for answers? Try searching our database.

AxSHDocVw.AxWebBrowser

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kristof Thys - 15 Dec 2004 09:40 GMT
First, I hope this is the correct newsgroup for my problem. My apologies
if it isn't so.

The AxWebBrowser is driving me crazy at the moment.

In my application I want to catch all the clicked links from the user
and give new meanings to it. The html-pages contain javascript and css
but as far as I understand this isn't a problem.

This is how I try to do it:

In the load of my form:

Object o = null;
axWebBr.Navigate("about:blank", ref o, ref o, ref o, ref o);
theHtmlDocument = (mshtml.IHTMLDocument2)axWebBr.Document;
theHtmlDocument.write(m_HtmlGenerator.GetTaskList(158,true));

Where m_HTMLGenerator generates an HTML string.

This document is shown fine in the browser.

When a user clicks a link, I presume "private void
axWebBr_BeforeNavigate2(object sender,
AxSHDocVw.DWebBrowserEvents2_BeforeNavigate2Event e)" is called.
In there I want to change the document to e.g. the result of
m_HTMLGenerator.GetTaskList(158,false)...

I've tried doing this via:
theHtmlDocument.write( m_HtmlGenerator.GetTaskList(158,false));

or

mshtml.IHTMLElement body = (mshtml.IHTMLElement)theHtmlDocument.body;
body.innerHTML = HTMLString;
(wich seems wrong because the <header> isn't changed)

...

The axWebBr_BeforeNavigate2 function seems to be called twice when the
user clicks a hyperlink. I don't see why.

Does anyone have experience in doing such things,
or is there any documentation on this subject? I would really like to
know how this browser works exactly and what events are raised at what
time....

thanks for any help,

Kind Regards,

Kristof Thys
Roy Soltoff - 21 Dec 2004 21:25 GMT
I trap the BeforeNavigate2 event to grab the Url of the link from the
EventArgs. But in my application, I am always canceling the event which
cancels the link. Then I handle the Url in my own manner. Perhaps you could
do something similar? You can't change the Url that is passed because the
arg is ByVal; thus the values you receive are local to you.

> First, I hope this is the correct newsgroup for my problem. My apologies
> if it isn't so.
[quoted text clipped - 48 lines]
>
> Kristof Thys

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.