I'm working with WebHTMLEditor to allow business users to create content for a site, and some business users would like to copy and paste from Word directly into the editor.
This works well enough until the user clicks the save button. If I debug the error I get the following exception:
An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll
It seems to occur when quite a lot of XHTML has to be parsed. I've tried cleaning up the XHTML by removing all attributes and leaving just the nodes and the text, but the error still occurs. I've also made sure the XHTML is well-formed. There is some part of the XHTML that contains several nested nodes, and seems to cause the error when saving.
I tried trimming the XHTML to isolate the node that caused the error. If it's by itself, it doesn't cause an error, but it I include enough sibling nodes then it crashes.
Is there some limit to the depth of number of nodes allowed in the XHTML?
The call stack is as follows.
> mscorlib.dll!System.DateTimeFormat.FormatCustomized(System.DateTime dateTime, string format, System.Globalization.DateTimeFormatInfo dtfi) + 0x879 bytes mscorlib.dll!System.DateTimeFormat.Format(System.DateTime dateTime, string format, System.Globalization.DateTimeFormatInfo dtfi) + 0xf1 bytes mscorlib.dll!System.DateTime.ToString(string format, System.IFormatProvider provider) + 0x1c bytes infragistics.webui.webhtmleditor.v7.1.dll!Infragistics.WebUI.WebHtmlEditor.log.logMsg(Infragistics.WebUI.WebHtmlEditor.log.logType type, string message) + 0x3f bytes infragistics.webui.webhtmleditor.v7.1.dll!Infragistics.WebUI.WebHtmlEditor.HtmlReader.ProcessData(System.Xml.XmlNode parent) + 0xe5 bytes infragistics.webui.webhtmleditor.v7.1.dll!Infragistics.WebUI.WebHtmlEditor.HtmlReader.ProcessData(System.Xml.XmlNode parent) + 0x65a bytes infragistics.webui.webhtmleditor.v7.1.dll!Infragistics.WebUI.WebHtmlEditor.HtmlReader.ProcessData(System.Xml.XmlNode parent) + 0x3d2 bytes infragistics.webui.webhtmleditor.v7.1.dll!Infragistics.WebUI.WebHtmlEditor.HtmlReader.ProcessData(System.Xml.XmlNode parent) + 0x65a bytes infragistics.webui.webhtmleditor.v7.1.dll!Infragistics.WebUI.WebHtmlEditor.HtmlReader.ProcessData(System.Xml.XmlNode parent) + 0x3d2 bytes infragistics.webui.webhtmleditor.v7.1.dll!Infragistics.WebUI.WebHtmlEditor.HtmlReader.ProcessData(System.Xml.XmlNode parent) + 0x65a bytes infragistics.webui.webhtmleditor.v7.1.dll!Infragistics.WebUI.WebHtmlEditor.HtmlReader.ProcessData(System.Xml.XmlNode parent) + 0x31e bytes infragistics.webui.webhtmleditor.v7.1.dll!Infragistics.WebUI.WebHtmlEditor.HtmlReader.ProcessData(System.Xml.XmlNode parent) + 0x65a bytes infragistics.webui.webhtmleditor.v7.1.dll!Infragistics.WebUI.WebHtmlEditor.HtmlReader.ProcessData(System.Xml.XmlNode parent) + 0x31e ......... infragistics.webui.webhtmleditor.v7.1.dll!Infragistics.WebUI.WebHtmlEditor.HtmlReader.ProcessData(System.Xml.XmlNode parent) + 0x65a bytes infragistics.webui.webhtmleditor.v7.1.dll!Infragistics.WebUI.WebHtmlEditor.HtmlReader.ProcessData(System.Xml.XmlNode parent) + 0x31e bytes infragistics.webui.webhtmleditor.v7.1.dll!Infragistics.WebUI.WebHtmlEditor.HtmlReader.ProcessData(System.Xml.XmlNode parent) + 0x65a bytes infragistics.webui.webhtmleditor.v7.1.dll!Infragistics.WebUI.WebHtmlEditor.HtmlReader.ProcessData(System.Xml.XmlNode parent) + 0x31e bytes infragistics.webui.webhtmleditor.v7.1.dll!Infragistics.WebUI.WebHtmlEditor.HtmlReader.ProcessData(System.Xml.XmlNode parent) + 0x65a bytes infragistics.webui.webhtmleditor.v7.1.dll!Infragistics.WebUI.WebHtmlEditor.HtmlReader.ProcessData(System.Xml.XmlNode parent) + 0x31e bytes infragistics.webui.webhtmleditor.v7.1.dll!Infragistics.WebUI.WebHtmlEditor.HtmlReader.ProcessData(System.Xml.XmlNode parent) + 0x65a bytes infragistics.webui.webhtmleditor.v7.1.dll!Infragistics.WebUI.WebHtmlEditor.HtmlReader.ProcessData(System.Xml.XmlNode parent) + 0x31e bytes infragistics.webui.webhtmleditor.v7.1.dll!Infragistics.WebUI.WebHtmlEditor.HtmlReader.ProcessData(System.Xml.XmlNode parent) + 0x65a bytes infragistics.webui.webhtmleditor.v7.1.dll!Infragistics.WebUI.WebHtmlEditor.HtmlReader.ProcessData(System.Xml.XmlNode parent) + 0x31e bytes infragistics.webui.webhtmleditor.v7.1.dll!Infragistics.WebUI.WebHtmlEditor.HtmlReader.ProcessData(System.Xml.XmlNode parent) + 0x65a bytes infragistics.webui.webhtmleditor.v7.1.dll!Infragistics.WebUI.WebHtmlEditor.HtmlReader.ProcessData(System.Xml.XmlNode parent) + 0x3d2 bytes infragistics.webui.webhtmleditor.v7.1.dll!Infragistics.WebUI.WebHtmlEditor.HtmlReader.ProcessData(System.Xml.XmlNode parent) + 0x65a bytes
It's hard to say for sure what's going on, without reproing the behavior. If you have a string that will repeatedly cause this crash when pasted into the HTMLEditor, I'd recommend sending that to the Infragistics Developer Support team (www.infragistics.com/gethelp) I'd tell you to paste it here, but I have a feeling many of the characters will get convereted to HTML literals, etc.
i'd guess one of 2 things is happening here - either the code is reaching a maximum recursion depth and it's not a problem with the input, or the input is in someway causing an infinite loop. Either way, I think we should have a look and see how we can avoid this scenario in the editor.
-Tony
I've had a similar problem and I did open a ticket for it. Of course, the first time through support, they don't think it through and I have to explain even further.
What happens in my case when users get all paste happy from Word or Excel even, when I go to read the texthtml? property, it crashes the worker process. Get five people to do that in five minutes and it shuts down the site thanks to the application pool settings. Tony, I don't know if you could breathe some life into my ticket or not. WHE806.