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
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