ASP.NET

G

Guest

Hi,

I am writing an ASP.NEt application in which I am callling other ASP.NET
application (I have written URL in the web.config of other application) and I
am transfering a string on a click event.

My question is how can I read the string in other application and give a
response back to the first application that it has read

here is my code in first application ...

if(ConfigurationSettings.AppSettings["Track_Application_Check"]=="true")
{
Byte[] buf = System.Text.Encoding.UTF8.GetBytes(strTrackXML.ToString());
//Response.Write(buf);
//Response.End();
HttpWebRequest objRequest =
(HttpWebRequest)WebRequest.Create(ConfigurationSettings.AppSettings["TrackApplicationURL"]);
objRequest.Method = "POST";
objRequest.ContentType = "text/html";
Stream HttpStream;
HttpStream = objRequest.GetRequestStream();
HttpStream.Write(buf, 0, buf.Length);
HttpStream.Close();
objRequest.KeepAlive=false;
objRequest.Timeout = 60000;




HttpWebResponse objResponse =
(HttpWebResponse)objRequest.GetResponse();
//Response.Write(objRequest);
//Response.Write(objRequest.GetResponse());
//Response.End();


XmlDocument resultsDoc = new XmlDocument();
resultsDoc.Load(objResponse.GetResponseStream());
string strStatus =
resultsDoc.GetElementsByTagName("status").Item(0).InnerText;
if (strStatus == "1")
{
Response.Write("Release added sucessfully");
Response.End();
}
}


Please help...

thanks and Regards
Raj
 
G

Guest

Thanks for the reply...I am not trying very basic thing i.e want to transfer
the string and get back the status say 1 from the other apllication and it is
a Web Application.

raj

Robbe Morris said:
This article has code that does this form a .NET Compact Framework
app to a web page and back again.

http://www.eggheadcafe.com/articles/compactframeworkencryption.asp

--
2004 and 2005 Microsoft MVP C#
Robbe Morris
http://www.masterado.net

Earn $$$ money answering .NET Framework
messageboard posts at EggHeadCafe.com.
http://www.eggheadcafe.com/forums/merit.asp



Raj said:
Hi,

I am writing an ASP.NEt application in which I am callling other ASP.NET
application (I have written URL in the web.config of other application)
and I
am transfering a string on a click event.

My question is how can I read the string in other application and give a
response back to the first application that it has read

here is my code in first application ...

if(ConfigurationSettings.AppSettings["Track_Application_Check"]=="true")
{
Byte[] buf = System.Text.Encoding.UTF8.GetBytes(strTrackXML.ToString());
//Response.Write(buf);
//Response.End();
HttpWebRequest objRequest =
(HttpWebRequest)WebRequest.Create(ConfigurationSettings.AppSettings["TrackApplicationURL"]);
objRequest.Method = "POST";
objRequest.ContentType = "text/html";
Stream HttpStream;
HttpStream = objRequest.GetRequestStream();
HttpStream.Write(buf, 0, buf.Length);
HttpStream.Close();
objRequest.KeepAlive=false;
objRequest.Timeout = 60000;




HttpWebResponse objResponse =
(HttpWebResponse)objRequest.GetResponse();
//Response.Write(objRequest);
//Response.Write(objRequest.GetResponse());
//Response.End();


XmlDocument resultsDoc = new XmlDocument();
resultsDoc.Load(objResponse.GetResponseStream());
string strStatus =
resultsDoc.GetElementsByTagName("status").Item(0).InnerText;
if (strStatus == "1")
{
Response.Write("Release added sucessfully");
Response.End();
}
}


Please help...

thanks and Regards
Raj
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top