Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 30th, 2006, 06:58 AM
Authorized User
 
Join Date: Aug 2004
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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()

 
Old January 30th, 2006, 08:04 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hii brettk_1!!!
Same questions on multiple forums
http://p2p.wrox.com/topic.asp?TOPIC_ID=39315

Cheers :)

vinod





Similar Threads
Thread Thread Starter Forum Replies Last Post
Form post page redirect problem - S.O.S. jroxit ASP.NET 1.0 and 1.1 Professional 4 May 21st, 2008 11:06 AM
how to post variable on response.redirect????? Swetz Classic ASP Components 3 May 16th, 2006 06:37 AM
problem reciving check box values using post metho method Pro PHP 1 March 10th, 2006 08:27 PM
POST values and redirect brettk_1 ASP.NET 2.0 Professional 1 January 30th, 2006 08:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.