Using HTC's in design mode

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

From: Colin Green (bughunter_at_hotmail.com)
Date: 07/05/04


Date: 5 Jul 2004 05:29:05 -0700

Here is another problem with MSHTML I have been unable to resolve,
originally posted to a less apt ng...

I noticed that when I load a HTML document that contains HTML
Components (HTCs) into IE6, that the HTC elements disappear if I
programatically switch the HTML document into design mode. Very simply
I do this by setting IHTMLDocument2.designMode=true

An alternative way of doing this is to ensure there is a
contentEditable="true" attribute on the <body> element in the document
before I load it. This does solve this particular problem, but this
causes problems for me elsewhere, e.g. I am currently using
IPersistStreamInit.IsDirty() to determine if the document has been
edited - if I use contentEditable="true" then this flag no longer
reflects the state of the document - it is as though the
IPersistStreamInit object becomes disconnected (HandsOffStrorage?)
from the underlying HTML Document.

Some possible problems are that (I think I read) scripting is disabled
with designMode on, perhaps this prevents the HTCs from rendering.
Another possibility lies with security settings and internet zones,
could this cause HTC to not render?

Perhaps if I could place the HTC definitions within the document I am
trying to render this would solve the problem? Unfortunately I can't
see any way of doing this.

Any ideas?

Thanks in advance,

Colin Green



Relevant Pages

  • Re: ARgghh--smarter browser??
    ... But the DOM model in HTML 4.01 often requires the whole document to be read before even the beginning of it could be rendered. ... But stable "render as you load" ability got lost. ... Few browsers made use of the ability to provide stable rendering with HTML 3.2, so I guess the guys at w3c decided that it could be sacrificed in a move to better CSS control. ...
    (comp.sys.mac.apps)
  • XP SP2 and HTCs in webbrowser control
    ... The page that attempts to load the HTC is generated by loading "about:blank" ... If I write the HTML page to disk and then use Navigate2to load it from ... it loads and executes the Javascript in the HTC. ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Re: accessing a scripts tag (and attributes)
    ... custom properties on the script tag would make it easier for HTML ... designers to include functionality on the page. ... allows you access to the containing HTC tag (along with many other cool ...
    (comp.lang.javascript)
  • Re: Paypal without HTML email
    ... > Well the reason I suggested Google mail is because it reads HTML without ... the last thing I want is to be able to render it. ... > Actually it's a complete myth that plain text is somehow more secure than ... formatting in its registration process than you've done in discussing ...
    (uk.people.consumers.ebay)
  • Re: HTML Formatting in .NET 2.0
    ... > You should be aware, though, that the reason this is used is because XHTML ... > will eventually supercede HTML on the WWW. ... > will eventually cause all browsers to render content in the same way. ... Putting CSS styles into an external style sheet, ...
    (microsoft.public.dotnet.framework.aspnet)