///======================in C# writeSession.aspx
///Session("loginID") == "tmp";
MSXML2.XMLHTTPClass xmlHttp = new XMLHTTPClass();
try
{
XmlDocument xmlDom = new XmlDocument();
xmlDom.loadXml("<root loginID=\""+ Session("loginID")+ "\"/>");
string Url = Request.ServerVariables["Http_Host"];
Url = "http://" + Url + "/loginx/getDataXml.asp";
string xml = xmlDom.OuterXml;
xmlHttp.open("post",Url,false,null,null);
xmlHttp.send(xmlDom.OuterXml);
//====Please look at this
//Response.Write(xmlHttp.responseXml);
//The top line :I think it will return xml entity body,but it return
System._ComObject;
//and I want to use xmlDom.loadXml(xmlHttp.responseXml); obviously
it can't work;
//Now I'm using xmlDom.loadXml(xmlHttp.responseText);
//but if I want to use xmlDom.loadXml(xmlHttp.responseXml); Who can
tell me what shall I do?
}
///======================in C#
'///======================in /loginx/getDataXml.asp
Dim XmlDom,Node
set XmlDom = Server.CreateObject("Microsoft.XmlDom")
XmlDom.Load Request
Set Node = XmlDom.SelectSingleNode("//root")
If TypeName(Node) <>"Nothing" then
Session("LoginID") = Node.getAttribute("loginID")
End If
Response.ContentType = "text/xml"
Response.Write "<?xml version=""1.0"" encoding=""gb2312""?>"
Response.Write "<root returnStr=""Session("LoginID")""/>"
Set XmlDom = Nothing
'===================Now I can get the returnStr from writeSession.aspx ,like
this
http://localhost/writeSession.aspx
'===================it equals "tmp"
'===================But when I visit /loginx/getDataXml.asp in the same IE
,like this ,
'===================http://localhost/loginx/getDataXml.asp
'===================and I get the resultstr equals ""
'===================I open the aspx and the asp webprograme at the same
IE,but session
'===================can't pass between getDataXml.asp to getDataXml.asp,who
can tell me why
'===================and how to pass Session between them.
'///======================in /loginx/getDataXml.asp