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 sendToXMLGateWa y()
{
string valueToReturn = "";
string lcUrl = "http://mywebsite.com/vbprogram.aspx" ;
HttpWebRequest webreq = (HttpWebRequest ) WebRequest.Crea te
(lcUrl);
HttpWebResponse loWebResponse = (HttpWebRespons e)
webreq.GetRespo nse();
valueToReturn = loWebResponse.S tatusCode.ToStr ing();
loWebResponse.C lose();
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.EventArg s) Handles MyBase.Load
Response.Status Code = "200"
End Sub