Sending information from an ASPX page to ASP page using form and post method

  • Thread starter Ricardo Magalhaes
  • Start date
R

Ricardo Magalhaes

Hi,

I have an ASPX page and I need to call an ASP page sending parameters like
Name, Adress, ie. using POST method. This next ASP page show payment
informations..

If was from an ASP to another ASP page I'll write the code:

<form action=boleto.asp method=post>
<input type=text name="adress" value="adress abc">
<input type=submit name="Send">
</form>

In ASP.NET 1.1 we can't call another page using post method. I saw
the URL http://www.netomatix.com/HttpPostData.aspx that explain how to do it

Then in my webcontrol button ASPX, I wrote the code:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim myReq As HttpWebRequest =
WebRequest.Create("http://localhost/boleto.asp")
Dim postData As String = "endereco=" + lblEndereco.Text
Dim encoding As New ASCIIEncoding
Dim byte1 As Byte() = encoding.GetBytes(postData)

' Set the content type of the data being posted.
myReq.ContentType = "application/x-www-form-urlencoded"
myReq.Method = "POST"

' Set the content length of the string being posted.
myReq.ContentLength = postData.Length

Dim newStream As Stream = myReq.GetRequestStream()
newStream.Write(byte1, 0, byte1.Length)
newStream.Close()
End Sub

But the next page, was not displayed. How can I do it.. ? The user to need
print the payment informations.

Regards,

Ricardo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top