This is Ians XML"; PageMethods.GetDocument(encodeURI(test" /> This is Ians XML"; PageMethods.GetDocument(encodeURI(test" /> This is Ians XML"; PageMethods.GetDocument(encodeURI(test"/>

PageMethod returning full html page

241 views Asked by At

I have a page method:

var test = "<?xml version='1.0'?><query><drawioIan>This is Ians XML</drawioIan></query>";
                PageMethods.GetDocument(encodeURI(test), onSuccess, onFailure);
                function onSuccess(result) {
                    debugger;
                    //XML returned, so need to drill into it.
                    alert(result.firstChild.childNodes[0].innerHTML);
                }
                function onFailure(error) {
                    debugger;
                    alert(error);
                }

That is suppoused to call a webmethod:

[WebMethod]
    [ScriptMethod(ResponseFormat = ResponseFormat.Xml, UseHttpGet = true, XmlSerializeString = true)]
    public static System.Xml.XmlDocument GetDocument(string svg)
    {
        string test = HttpUtility.UrlDecode(svg);
        //Response Is sent back as xml, you might be able to send back json instead - might be handier.
        System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
        xmlDoc.LoadXml("<root><item>Hello World</item></root>");
        return xmlDoc;
    }

The webmethod does not get called but I am receiving a status code 200 enter image description here

Retuned is the whole html page: enter image description here

The breakpoint on the webmethod does not get triggered either. Does anyone have any idea what the issue may be?

EDIT: WebMetho gets skipped but still comes back with onSuccess(): enter image description here

0

There are 0 answers