Populate form with a asp.net web-service

I want to populate the form data of a dhtmlxForm with an asp.net web-service.
In Mozilla this works fine but with Internet Explorer the form is not populated.

Web-service example:

   [WebMethod]
    public void GetData()
    {
        Context.Response.Write("<?xml version=\"1.0\"?><data><field1>T E S T</field1></data>");
    }

Javascript:

...
formEdit.load(<url> + "GetData");
...

Why form is not populatetd with Internet Explorer?

To reproduce your issue we need completed demo or direct link.
docs.dhtmlx.com/doku.php?id=othe … leted_demo

Hello,

I’ve attached a zip file with a complete demo.
Complete Demo.zip (1.04 MB)

hi

add “var” before variable and use callback for loading values, due async requests, there is a case when “form struct” will responsed after “form data”

var myForm = new dhtmlXForm("myForm"); myForm.loadStruct("xml/form.xml?e="+new Date().getTime(), function(){ myForm.load("xml/data.xml?e="+new Date().getTime()); });

I’ve tried your solution, but the problem still exists:
The field is not populated with Internet Explorer (9) but with Mozilla.

You can test it:
Loading from file:
http://t03.combi-connect.net/complete%20demo/index_file.html

Loding from web-service:
http://t03.combi-connect.net/complete%20demo/index_ws.html

Works with file not works with web service.
Please attach uncompressed dhtmlxform.js (from sources filder) after dhtmlx.js to completed demo.

So, I’ve put dhtmlform.js after dhtmlx.js:

...
 	  <script type="text/javascript" src="codebase/dhtmlx.js"></script>
 	  <script type="text/javascript" src="codebase/dhtmlform.js"></script>
...

but nothing changed.

Hi

probably should be:

Ok, I’ve corrected the error but nothing changed.

Hi

dhtmlx.js file from version 3.0,
dhtmlxform.js from 3.5

please attach corresponding dhtmlxform.js not compressed.

also your response not have “Content-Type: text/xml” header, maybe this is problem

Ok, the problem was that the header doesn’t include ContentType = “text/xml”.
Now it work’s, thanks.