Results 1 to 3 of 3

Thread: XML.sendAndLoad() not working IIS7. ASP.Net 2.0 (C# 3.0)

  1. #1

    Afrostyle XML.sendAndLoad() not working IIS7. ASP.Net 2.0 (C# 3.0)

    Well, it's not totally true that's it's not working.

    If I send a request with NO xml, it works just fine. But as soon as I add xml to the flash XML object it fails.

    To illustrate this I made to simple scenarios, both of them hitting the following C# code:

    Save.aspx (C#)
    Code:
    public partial class Save: System.Web.UI.Page
    {
       protected void Page_Load(object sender, EventArgs e)
       {
           string xmlOut = "<response test=\"true\"/>";
           Response.Clear();
           Response.CacheControl = "no-cache";
           Response.ContentType = "text/xml";
           Response.Write(xmlOut);
       }
    }
    WORKING ActionScript 2.0
    Code:
    var xmlResponse:XML = new XML();
    xmlResponse.onLoad = function(success) {
       trace(success);
    }
    var xmlSend:XML = new XML(); //<-- pay attention here.
    xmlSend.sendAndLoad("http://localhost/Save.aspx",xmlResponse);
    NOT WORKING ActionScript 2.0
    Code:
    var xmlResponse:XML = new XML();
    xmlResponse.onLoad = function(success) {
    trace(success);
    }
    var xmlSend:XML = new XML("<test />"); //<-- see? :)
    xmlSend.sendAndLoad("http://localhost/Save.aspx",xmlResponse);
    I have absolutely NO IDEA what could be causing this. I've checked my IIS logs and I can see that it's returning 500 errors.

    Most curiously is I can't get it to hit a breakpoint in the ASP.Net code when it fails. Even after reboots.

    Does anyone know what I can do? or have any ideas?

  2. #2

    The answer was simple, actually.

    You have to set ValidateRequest = false on the ASP.Net page.

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Save.aspx.cs" Inherits="Save" ValidateRequest="false" %>

  3. #3
    Quote Originally Posted by blesh View Post
    The answer was simple, actually.

    You have to set ValidateRequest = false on the ASP.Net page.

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Save.aspx.cs" Inherits="Save" ValidateRequest="false" %>
    Blesh,

    Thx a lot. Been searching for this solution for hours.

    Glad found it here.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012