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

Discussion in 'ASP .Net' started by Ricardo Magalhaes, Jun 3, 2005.

  1. 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
     
    Ricardo Magalhaes, Jun 3, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sriram Mallajyosula

    How do I post data from aspx page to another aspx page.

    Sriram Mallajyosula, Nov 5, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    988
    Steve C. Orr [MVP, MCSD]
    Nov 5, 2003
  2. Houman
    Replies:
    0
    Views:
    412
    Houman
    Aug 12, 2004
  3. botdf

    Get POST information from <form>......</form>

    botdf, Jan 26, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    181
    Joerg Jooss
    Jan 29, 2005
  4. Don Glover the younger

    ASP, FORMS, POST METHOD And Post with out form(???)

    Don Glover the younger, Jul 13, 2003, in forum: ASP General
    Replies:
    0
    Views:
    465
    Don Glover the younger
    Jul 13, 2003
  5. Replies:
    0
    Views:
    117
Loading...

Share This Page