MSHTML and Table Background problem
- From: "Sunray" <sunray@xxxxxxxxxxxxxxxxx>
- Date: Wed, 14 Mar 2007 10:09:17 -0000
Hello
i am experiencing some wierd behaviour of the MSHTML control,
we are using it as a html wysiwyg editor and have design, html and preview
views.
When in the html view the user can manipulate the html directly.
The problem occurs when the user gives a table or div the
background="image.gif" attribute.
After the user enters this code and clicks ok they are returned to a simple
html editor which is basically just the design version (ala frontpage) still
using the mshtml control.
Below is the general jist of the OK button:
htmlSimpleEditor.HtmlDocument.designMode = "On";
htmlSimpleEditor.HtmlDocument.write(
m_editCode.Text.IndexOf("<BR>\n<SCRIPT") < 0?
m_editCode.Text.Replace("<SCRIPT", "<BR><SCRIPT"): m_editCode.Text );
htmlSimpleEditor.HtmlDocument.close();
this.HtmlText = htmlAdvanced.HtmlText;
After this code is executed the program crashes ( even during debug ) so i'm
lead to beleive this is happening outside of the scope of our project.
I get no error messages it just consumes 99% of cpu and stays like it until
i kill the process.
Any ideas on reasons why this could be happening?
I have come up with a very long winded work arround where i use javascript
to setup a background image onload for that particular table/div.
But this dosn't work in all views due to javascript needing to be ran.
I know that background is not a valid attribute of table in HTML but it does
work on normal pages and even in the preview pane of the advanced editor,but
when MSHTML gets control of it it seems to be going into an infinate loop or
something similar...
Thank you,
Seb.
.
- Prev by Date: IHTMLPainter on body element
- Next by Date: Avoid javascript in my browser
- Previous by thread: IHTMLPainter on body element
- Next by thread: Avoid javascript in my browser
- Index(es):