我有一个分页方法:
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);
}
可以调用一种网络方法:
[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;
}
也不会触发web方法上的断点。 有谁知道这个问题可能是什么?