473,396 Members | 2,020 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.

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

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.
Nov 18 '05 #1
2 1939
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?

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
"Rafael Zavulunov" <ra***@hotmail.com> wrote in message
news:30*************************@posting.google.co m...
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.

Nov 18 '05 #2
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?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #3

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

Similar topics

14
by: edykstra | last post by:
Hello, If you point your browser to this page, http://prdownloads.sourceforge.net/vnc-tight/tightvnc-1.2.9_x86_viewer.zip?use_mirror=umn the server sends you the HTML page, and very soon...
1
by: ij | last post by:
Hi, I'm trying to submit an image object, along with some other text fields to another web server from within an ASP page but am stuck on getting the image to be submitted with the form. In a...
5
by: Pete Loveall | last post by:
I have a server application that monitors a private local queue for messages. The message sent to it has a label and a response queue defined. It works correctly when the queue is accessed via...
4
by: Mark J. McGinty | last post by:
Greets, Part of the content of one of our web pages uses wingdings and Chr(239) through Chr(242) (which are little arrow outlines, though that's not really important.) It worked just fine in...
5
by: Prabhat Nath | last post by:
Hi All, Is that possible that I can send request to IIS Server after a .ASP page is displayed? My Requirement is: Clinet will Fill the Details in one Request Form after the details are...
5
by: zorhel | last post by:
Hi. My clients will be IE, Mozilla and Opera in a Windows and *nix OS. So, my web app need to, from a server, send messages to a specific client (browser), send messages for all clients,...
9
by: eswanson | last post by:
I have a web page I need to post a file plus some other fields to it. How can I do this from a asp.net page. I know I can send individual fields to the other page, but how do I send a file to the...
4
by: lawrence k | last post by:
If I've a big string and I want to send it to another web page as a GET request, I just use file(). I've done this often. But what command do I use when I want to send the same string as a POST...
4
by: André | last post by:
Hi, I try to create and render a graphic among other objects like e.g. tables, labels, buttons. The tables are not a problem, neither the graphic. My problem is that i can't render both...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.