Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Question of MSXML2 and Session From Aspx to Asp

1 réponse
Avatar
///======================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

1 réponse

Avatar
Zoury
wrong group dude. this one is dedicated to french speaking people.

see these groups for english assistance :
microsoft.public.dotnet.languages.vb
microsoft.public.dotnet.languages.csharp
microsoft.public.inetserver.asp.general

and **please** take your question out of the code so we can clearly read it.
You'll most likely get an answer to your question if people can see it. ;O)

--
Best Regards
Yanick
a écrit dans le message de
news:

///======================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
'==================Ên't pass between getDataXml.asp to


getDataXml.asp,who
can tell me why
'===================and how to pass Session between them.
'///======================in /loginx/getDataXml.asp