POST values and redirect
Hi All,
I have the following code which sends a POST to a webpage. This works fine but the problem I have is that I need to redirect to the page where the POST has been sent to. Can anyone help?
Server.Transfer and Redirect with querystring values are not options, the values must be in a POST and go to a webpage that I have no control over.
Please Help!!!:(
This post is also in the ASP.NET 2.0 Professional section
Dim encoding As New ASCIIEncoding
Dim postdata As String = "TestField=Brett123"
Dim data As Byte() = encoding.GetBytes(postdata)
Dim myReq As HttpWebRequest = WebRequest.Create("Default3.aspx")
myReq.Method = "POST"
myReq.ContentType = "application/x-www-form-urlencoded"
myReq.ContentLength = data.Length
Dim newStream As Stream = myReq.GetRequestStream
newStream.Write(data, 0, data.Length)
newStream.Close()
|