Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Yoann Maingon on Sep 09, 2009 09:23
open dhtmlx forum
Grid LoadXML fails with Server Request

Hi,

I have a problem when trying to load XML to a gid.
I can load a file ".xml"
but when i try to load xml data by calling a server method. It fails with the message (error type: load XML / Description: Incorrect XML)
here is the client code:

dhxTree.attachEvent("onClick", function(nodeId) {

dhxGrid.clearAll(); //remove all data
gridQString = "GetDocuments.aspx?ID=" + nodeId ; //save query string in global variable (see step 5 for details)
dhxGrid.loadXML(gridQString); // load new dataset from sever with additional parameter passed
}

and here is what the server page produces:

<?xml version='1.0' encoding='utf-8' ?>
<rows>
<row id='a'>
<cell>Projet Pipe Stavenger</cell>
<cell>RFP-9875-0109</cell>
<cell>Henry Dupont</cell>
<cell>21/08/2009</cell>
<cell>10/11/2009</cell>
</row>
</rows>

from the following code:

<%
dim valeur as string
dim texteretour as string
valeur = Request.QueryString("ID")
texteretour = RecupFichiers(ID)
Response.Write(texteretour) '<-- texteretour gets the string with the result data shown above.
%>

I have no idea why it doesn't work as it is the same format that i use in my xml files that i can load.

thanks in advance for your help
Answer posted by Support on Sep 09, 2009 09:30
You need to set content type of response as "text/xml"
Answer posted by yoann maingon on Sep 09, 2009 09:55
Yop, that's right!!
thanks a lot !