This is the discussion forum for the HtmlEditor. See also the HtmlEditor home page, where you can download the control, and the Documentation Wiki, a collaborative project for documenting the control.
then the source is fine... but after editing in form2, when I set a string to equal the Form2.HTMLEditor.GetDocumentSource I get a bunch of extra HTML including DOCTYPE declaration and a GENERATOR meta tag.
Why does the same method (GetDocumentSource) have different results for the two controls? How do I get the method to NOT add the extra HTML?
I've tried setting IsDesignMode = False before calling GetDocumentSource, but then, the only source I get is <HTML></HTML>
It's just weird that the same method call against essentially identical controls produces 2 different results. The first GetDocumentSource does what I want, the 2nd one doesn't... something has to be allowing the 1st call to do what I want, I just can't find it.
Yes, I did find your last statement to be true... I tried getting a handle on my HTML tag then grabbing the OUTERHTML, but it still contained the GENERATOR META tag.
Since my application of this is only concerned with what's in the BODY tag, I did this...
------------------------------
Dim collHTML As mshtml.IHTMLElementCollection = HtmlEditor2.Document.getElementsByTagName("BODY")
Dim elem As mshtml.IHTMLElement = collHTML.item(0)
Dim s As String = s = elem.outerHTML.Trim
------------------------------