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.
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.