Hi Kevin,
This is half of what I want to do. Let me give you some additional
background on what I am doing. I am building a website that is the primary
user interface for my company's products. To give our clients the best
possible experience using our product, we have enriched each of the website
pages with client-side script in form of DHTML Behaviors. These scripts
perform various tasks such as building HTML Tables, calling webservices, and
posting back collected data via XMLHTTP. So far, the site with the script
works fairly well, but the script is extremely slow and cumbersome to work
with. There are also memory leak issues caused by they way the scripting
engine interacts with MSHTML. So while using script is possible, it is not
very desirable.
What I want to do, is to replace some (if not all) of the script with a .NET
component. I want this component to be created and hosted by IE through the
<object> tag in such a way that I do not have to request .NET permissions
other than those granted by default to components running in the "Internet
Zone." Once the component represented by the <object> tag is loaded, I'm
going to want it to make changes to its containing HTML DOM in order to
render HTML tables and do all those things I do in script now.
So far I have written a test component and loaded it into a test HTML
document, but I don't know how to get a reference to the containing
document.
Your help in the matter is very appreciated.
Wells
"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:J6**************@cpmsftngxa10.phx.gbl...
Hi Wells,
First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to know how to implement in
your classes in that assembly in order to allow those classes to interact
with the DHTML DOM. If there is any misunderstanding, please feel free to
let me know.
As far as I know, to access the DOM programmatically, you import both the
Web browser component and references to the methods, properties, and
events of the DOM into your C# project. You direct the Web browser to a URL by
calling its Navigate method, and you must then wait for the documentation
complete event. You obtain the document by casting the Web browser
Document property to an IHTMLDocument2 interface object. You can query this object
for its collections, such as its link or image collections, which are
returned as IHTMLElementCollection objects.
Here is an article for a walkthrough. HTH.
http://msdn.microsoft.com/library/de...us/dv_vstechar t/html/vsgrfWalkthroughAccessingDHTMLDOMFromC.asp
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."