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.
Img. Cannot init the src attirb
Posted by:
Alexander (---.35.117.87.donpac.ru)
Date: Wednesday, 27-May-2009, 09:54:51
I am trying to add an image element into Html-document. The code, that do it is the follows:
IHTMLDocument2 doc = ((IHTMLDocument2)_htmlText.Document);
IHTMLImgElement i = (IHTMLImgElement)(doc.CreateElement("img"));
IHTMLDOMNode nd = (IHTMLDOMNode)i;
IHTMLDOMNode parent = (IHTMLDOMNode)_htmlText.CurrentElement;
parent.appendChild(nd);
Uri adr = new Uri(value);
((IHTMLImgElement)_Element).src = adr.AbsoluteUri;
After this code worked, the scr attribute is null. What is wrong? Help, please.