我用asp.net作过,没有问题的,给你代码看看 A页 提交,监听 var g_xmlhttp = new ActiveXObject( "Microsoft.XMLHTTP" ); var xml = new ActiveXObject( "Msxml.DOMDocument" ); var root = xml.createElement("account"); xml.appendChild( root ); var node; node = xml.createElement(DeviceAccidentRate.rows(0).cells.item(i).value); node.text = cells.item(i).value; root.appendChild( node ); //post data to server g_xmlhttp.open( "POST", "updateEvaluation.aspx?type=1", false ); g_xmlhttp.send( xml );
if( g_xmlhttp.status != "200" ) { alert( g_xmlhttp.statusText ); return false; } return true; B页 响应 Dim xmlstream As Stream = Request.InputStream Dim xml As XmlDocument = New XmlDocument() Try xml.Load(xmlstream) Dim uid As String Dim timeid As String uid = xml.SelectSingleNode("//account/" & Trim(value.InnerText)).InnerText timeid = xml.SelectSingleNode("//account/计算发生时间").InnerText Response.StatusCode = 200 Response.StatusDescription = "OK" Catch ex As Exception Response.StatusCode = 500 Response.StatusDescription = "更新帐户时发生异常:" + ex.Message End Try
A页 提交,监听
var g_xmlhttp = new ActiveXObject( "Microsoft.XMLHTTP" );
var xml = new ActiveXObject( "Msxml.DOMDocument" );
var root = xml.createElement("account");
xml.appendChild( root );
var node;
node = xml.createElement(DeviceAccidentRate.rows(0).cells.item(i).value);
node.text = cells.item(i).value;
root.appendChild( node );
//post data to server
g_xmlhttp.open( "POST", "updateEvaluation.aspx?type=1", false );
g_xmlhttp.send( xml );
if( g_xmlhttp.status != "200" )
{
alert( g_xmlhttp.statusText );
return false;
}
return true;
B页 响应
Dim xmlstream As Stream = Request.InputStream
Dim xml As XmlDocument = New XmlDocument()
Try
xml.Load(xmlstream)
Dim uid As String
Dim timeid As String
uid = xml.SelectSingleNode("//account/" & Trim(value.InnerText)).InnerText
timeid = xml.SelectSingleNode("//account/计算发生时间").InnerText
Response.StatusCode = 200
Response.StatusDescription = "OK"
Catch ex As Exception
Response.StatusCode = 500
Response.StatusDescription = "更新帐户时发生异常:" + ex.Message
End Try