Re: How do you use a .NET object in IE?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Wells Caughey (wellscaughey_at_hotmail.com)
Date: 05/18/04


Date: Tue, 18 May 2004 18:33:04 -0400

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-kevy@online.microsoft.com> wrote in message
news:J690tFLPEHA.3892@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/default.asp?url=/library/en-us/dv_vstechar
> t/html/vsgrfWalkthroughAccessingDHTMLDOMFromC.asp
>
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>



Relevant Pages

  • Re: speed issues traversing the DOM.
    ... It seems that in the javascript DOM context all you can do is give it an ... not markup no html. ... var itemRef, itemName, itemDOMElement; ...
    (comp.lang.javascript)
  • Re: Decoding html pages
    ... from the DOM (as one can see by using the DOM tool ... but it is removed from the HTML. ... the HTML page removes all references from firebug's DOM panel. ... The HTML panel of firebug surely shows the script gone. ...
    (comp.lang.javascript)
  • Cant make this page work
    ... I can't make this script work properly. ... The script at the bottom of the html page ... Does someone have a perl ... sub output_trace_headers { ...
    (comp.lang.javascript)
  • Re: Path info for VBscript from HTM page
    ... > I would like to run a vbscript from a html page on my website. ... > This script was placed in a html file, ... > it is put on my Desktop when I run the script from the HTML file. ... > upload the html file to my website and run the script I get an error. ...
    (microsoft.public.scripting.vbscript)
  • Re: Use with Action "Send Reply" Dont Go
    ... Set Up an HTML Signature ... Go to Tools/Signatures in Entourage, ... "Auto-Reply HTML" or something similar. ... script in the Entourage Script Menu Items folder. ...
    (microsoft.public.mac.office.entourage)