views:

719

answers:

2

Hello all

I'm an AS3 noob on training wheels...

I have an XML Loader class which is doing what it's supposed to with a test.xml file, however I need the flash to read the xml written by an aspx file.

So I tried:

var urlRequest:URLRequest = new URLRequest("../xml/CaseStudyFlashAssets.aspx");

I get error #1090 (which I gather is because the aspx is not xml and it doesn't like it)

Can anyone help me get to the xml written by the aspx file?

Thanks

Mikey

A: 

Is your XML well-formed in your ASPX page? Are you setting the ContentType property on your ASPX page to text/xml?

Daniel A. White
A: 

A frequent problem with xml being supplied from a WebForm is newlines occuring before the actual xml. When I generate xml in .Net, I usually use a Generic Handler instead of a WebForm. That way, you get better control of the output. When I have to use a WebForm (in some cases when working with a CMS, the easiest way to get the data to return is to extend a base class which subclasses Page), I do all the work in the code behind:

XmlDocument doc = new XmlDocument();
//build the document
Response.Clear();
Response.ContentType = "text/xml";
Response.Write(doc.OuterXml);
Response.Flush();
Response.End();

This way, all the gunk from the .aspx file is removed from the response.

Johan Öbrink