Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to: Form post to remote page using code behind?

How to: Form post to remote page using code behind?

Scheduled Pinned Locked Moved ASP.NET
helptutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AndyBrew70
    wrote on last edited by
    #1

    Hi I have a third party payment system to integrate into my application. The final page in my application displays the order details and allows the user to confirm their order. Upon clicking confirm the order is created and at this point in my code behind file I would like to generate a post to a third party payment form that expects some form post values and the users browser should then be redirected to that page within the same session obviously so that the posted values can be used accordingly. Any help would be greatly appreciated :) Thanks in advance Andy

    D 1 Reply Last reply
    0
    • A AndyBrew70

      Hi I have a third party payment system to integrate into my application. The final page in my application displays the order details and allows the user to confirm their order. Upon clicking confirm the order is created and at this point in my code behind file I would like to generate a post to a third party payment form that expects some form post values and the users browser should then be redirected to that page within the same session obviously so that the posted values can be used accordingly. Any help would be greatly appreciated :) Thanks in advance Andy

      D Offline
      D Offline
      doWhileSomething
      wrote on last edited by
      #2

      Some API's are easier to work with then you think and while you did not mention which payment API your using, most are similar in how they are used/consumed. You can use the HttpWebRequest class to post values to a site (e.g. PayPal), but the premise is the same. Dim req As HttpWebRequest = CType(WebRequest.Create(API_URL), HttpWebRequest) ' Set values for the request back req.Method = "POST" req.ContentType = "application/x-www-form-urlencoded" If you need to post the values to the page and have the user perform some final steps on the page while keeping the user on your site, this can be a little more tricky. You would need to send the identifier for the cart/user from your site, so once they are redirected back to your site, you can perform the look up and react to the messages sent from the api. You should look into the documentation of the API though. Most times you can handle all of this without the user ever leaving your site - a much better implementation IMO.

      My Personal Site

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups