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