By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,459 Members | 1,472 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,459 IT Pros & Developers. It's quick & easy.

ASP.NET

P: n/a
Raj
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.ToS tring());
//Response.Write(buf);
//Response.End();
HttpWebRequest objRequest =
(HttpWebRequest)WebRequest.Create(ConfigurationSet tings.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

Nov 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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/...encryption.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" <Ra*@discussions.microsoft.com> wrote in message
news:0D**********************************@microsof t.com...
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.ToS tring());
//Response.Write(buf);
//Response.End();
HttpWebRequest objRequest =
(HttpWebRequest)WebRequest.Create(ConfigurationSet tings.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

Nov 17 '05 #2

P: n/a
Raj
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 [C# MVP]" wrote:
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/...encryption.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" <Ra*@discussions.microsoft.com> wrote in message
news:0D**********************************@microsof t.com...
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.ToS tring());
//Response.Write(buf);
//Response.End();
HttpWebRequest objRequest =
(HttpWebRequest)WebRequest.Create(ConfigurationSet tings.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


Nov 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.