I am having quite the difficulty in getting the Tree.LoadXML() method to work in my ASP.Net MVC app. I keep getting “Error Type: LoadXML” & “Description: Incorrect XML” Error messages. Before creating the MVC app I was able to successfully create a new regular Web Form app that I ported over the files from the dhtmlxConnector.Net samples. The ashx file worked perfectly and I was able to consume the XML with Tree.LoadXML() from my ported ashx file from the samples. However when I tried to do a similar port into my MVC app I get the errors. Any idea what I might be doing wrong? I changed almost nothing in the ashx file except leaving the existing namespace reference in my new project of course, otherwise everything is the same. I verified my connectionstring and everything else. Any ideas why I might be getting these errors?
Thank You in Advance!
Please check the acticle regarding “incorrect xml” issue:
docs.dhtmlx.com/doku.php?id=othe … orrect_xml
I’ve tried this over and over with still no success. Here’s the XML that is being returned by my ashx file in my MVC app:
Example 1.
From the ashx file in my ASP.NET MVC app: (Will not load - XML errors!)
<?xml version="1.0" encoding="utf-8" ?>
Example 2.
From the ashx file in the dhtmlxConnector.Net Samples: (Loads fine!)
<?xml version="1.0" encoding="utf-8" ?>
They are nearly identical except that one is from an MVC app and the other is from the .Net app supplied by the dhtmlxConnector.Net Sample. What am I missing? The only thing I can think of is that the MVC View handles the XML differently causing the error.
I’m initializing the tree structure the same in both applications:
tree = new dhtmlXTreeObject(“treeboxbox_tree”, “100%”, “100%”, 0);
tree.setImagePath(‘imgs/csh_winstyle/’);
tree.loadXML(“TreeDataHandler.ashx”);
Is there another option I am missing?
Please advise.
I found the issue! I had a syntax problem referencing the ashx file in the MVC app. It works just fine now.
Thanks Again!