Can i send an xml file from one page to another?

  • Thread starter Thread starter Rafael Zavulunov
  • Start date Start date
R

Rafael Zavulunov

Here's my question:

Our company has several web-apps and we're trying to create a central
login page as a separate web-app, which will then, based on the user's
selection, redirect the user to the correct app. Now, when a user logs
in, some info is retrieved from the DB and stored into an object,
which is serialized. I'm wondering if its possible to send the
serialized string from one aspx page to another, i was trying this:


code from sender page:

public void SendTextThruHttpStream(string strMessage, string strURL)
{
HttpWebRequest objHttpWebRequest = (HttpWebRequest)
WebRequest.Create(strURL);

objHttpWebRequest.Method = "POST";
StreamWriter objStreamWriter = new
StreamWriter(objHttpWebRequest.GetRequestStream());
objStreamWriter.Write(strMessage);
objStreamWriter.Close();
}

code from receiver:

public void DoStuff()
{
HttpWebRequest objRq = (HttpWebRequest)
HttpWebRequest.Create("http://127.0.0.1/HPDLogin/main.aspx");
HttpWebResponse objRs = objRq.GetResponse();
StreamReader strmReader = new StreamReader(objRs.GetResponseStream());
string strStuff = strmReader.ReadToEnd();
}

this didnt work, i checked the value of 'strStuff' at runtime w/ the
debugger and it was blank.

Does anyone have an idea why this isnt working?

Rafael Zavulunov.
 
Hi,

I think the receiving page should check for it's Request collection to get
what was sent instead of just making a request back?
 
I checked the collections on the Request object, nothing there. I dont
know, i'm starting to think that only a server app that listens on a
certain port, can receive the stream that I sent. Is there any other way
of transferring data from one application to another without resorting
to saving it to a DB? Perhaps by saving into the Application[] space?
 
Back
Top