S
Shane
I want the function in Code Snippet #1 below to return a
string of "200" by making a web request for
the vbprogram.aspx that contains the PageLoad function in
Code Snippet #2 below. Instead, I am getting a StatusCode
of "OK" instead of 200. What should I change here? Thanks
in advance for any help anyone may be able to give.
Code Snippet #1 (The function that does the web request.)
(from a C# program I wrote.)
public string sendToXMLGateWay()
{
string valueToReturn = "";
string lcUrl = "http://mywebsite.com/vbprogram.aspx";
HttpWebRequest webreq = (HttpWebRequest) WebRequest.Create
(lcUrl);
HttpWebResponse loWebResponse = (HttpWebResponse)
webreq.GetResponse();
valueToReturn = loWebResponse.StatusCode.ToString();
loWebResponse.Close();
return (valueToReturn);
}
Code Snippet #2 (From the vbprogram that should reply with
Status Code of 200.)
Private Sub Page_Load(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles MyBase.Load
Response.StatusCode = "200"
End Sub
string of "200" by making a web request for
the vbprogram.aspx that contains the PageLoad function in
Code Snippet #2 below. Instead, I am getting a StatusCode
of "OK" instead of 200. What should I change here? Thanks
in advance for any help anyone may be able to give.
Code Snippet #1 (The function that does the web request.)
(from a C# program I wrote.)
public string sendToXMLGateWay()
{
string valueToReturn = "";
string lcUrl = "http://mywebsite.com/vbprogram.aspx";
HttpWebRequest webreq = (HttpWebRequest) WebRequest.Create
(lcUrl);
HttpWebResponse loWebResponse = (HttpWebResponse)
webreq.GetResponse();
valueToReturn = loWebResponse.StatusCode.ToString();
loWebResponse.Close();
return (valueToReturn);
}
Code Snippet #2 (From the vbprogram that should reply with
Status Code of 200.)
Private Sub Page_Load(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles MyBase.Load
Response.StatusCode = "200"
End Sub