sendToURL screws up .Net

Hello all. Through my painful experience in upgrading my ActionScript 2.0 code to 3.0, I’m replacing old XML objects’ send() methods with the new flash.net.sendToURL method. In AS2, I called a .aspx page in the send() method. The .aspx page acts on the XML data that was sent via HTTP POST, and does a redirect to another aspx page. Here’s an excerpt:

in AS2:
var someData:XML = new XML();
someData.parseXML("<foo/>");
someData.send(“Yo.aspx”, “POST”, “_self”);

Yo.aspx sees the “<foo/>” data come through the HTTP POST and executes a Response.Redirect(“AnotherPage.aspx”);.

When I tried to convert this code to AS3, I noticed that the Response.Redirect stopped working! I first thought that this was a .Net issue, but I’m positive that the same .Net code is running for both the old AS2 and new AS3 code. Here’s what I’ve tried in AS3:

in AS3:
var someData:XMLDocument = new XMLDocument();
someData.parseXML("<foo/>");
var req:URLRequest = new URLRequest(“Yo.aspx”);
req.data = someData.toString();
req.method = “POST”;
sendToURL(req);

In debugging in .Net, I see that the “<foo/>” still comes through fine. In fact, the Response.Redirect works within the .Net debugger, but the screen doesn’t update with the newly-requested page. According to Adobe’s documentation, sendToURL doesn’t accept any data. This should be fine, as I only want to send data and redirect to another page. I don’t understand this behavior, but I suspect that sendToURL is executing in some sort of a sandbox that prohibits server-side code from redirecting to another page after the call is made.

Here’s one potential workaround that I’d rather not implement.

in AS3:
var req:URLRequest = new URLRequest(“test.aspx”);
req.data = “Hello”;
req.method = “POST”;
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, loadComplete);
loader.load(req);

private function loadComplete(event:Event):void {
navigateToURL(new URLRequest(event.currentTarget.data), “_self”);
}

in Yo.aspx:
Response.Write(“AnotherPage.aspx”); //rather than Response.Redirect(“AnotherPage.aspx”);

Sorry for the novel of a post, but if anyone has any insights here, I would appreciate your input! Thanks a lot!

Andy