473,396 Members | 1,768 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Question of MSXML2 and Session From Aspx to Asp


///======================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


Nov 16 '05 #1
0 1274

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: David | last post by:
A user logs into a web site. He is then redirected to a web page of his choosing - based on menu options - for example: "WeeklyReport.aspx" is a page the user is currently viewing If the user...
0
by: mike parr | last post by:
I am using Forms authentication for the first time, and I'm having problems with it. I have 3 pages relating to the login, default.aspx, default_new_user.aspx and default_user.aspx. ...
6
by: Steve B. | last post by:
Hello everybody In a webpage, I use JS display data from an xml file and a xsl file: var data = new ActiveXObject("Microsoft.XMLDOM"); data.async = false; var dataUrl = "data.aspx";...
7
by: Goober | last post by:
I have a page that receives a session variable from the default.aspx. On Page load, the code in Page load gets executed twice. So far, no problem. It sets the session variable each time,...
3
by: Timo | last post by:
In javascript code on MyPage.aspx, I set a hidden IFRAME's source url: myframe.location.href = 'someotherpage.aspx'; If the session has timed out, preventing someotherpage.aspx from being...
1
by: josepe | last post by:
Greetings, I use "Msxml2.XMLHTTP" in a asp page, to save changes of database in a html file. All worked well until I installed a new email server (ipswitch imail). Now this object don't work...
4
by: s_m_b | last post by:
Using w2k advanced server (test system is standard server) "Set objXML = Server.CreateObject("MSXML2.FreeThreadedDOMDocument") objXML.async = False objXML.setProperty "ServerHTTPRequest", True...
7
by: Cliff | last post by:
I'm not that great with ASP but I've hacked together a simple server side script that uses the Microsoft XML ServerXMLHTTP object. The problem is that when other people use the script sometimes...
1
by: Kandiman | last post by:
Hiya, i made a asp page, and one of my divs (as a include) is as below. the problem is if the main page is resubmitted, i get logged out again?... heres the code.. i think its on the value=true...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.