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. Post to another page

Post to another page

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netsysadminbusinesshelp
14 Posts 7 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.
  • V Offline
    V Offline
    VK Link
    wrote on last edited by
    #1

    Hi, This worked fine in our ASP web site but bit of an issue with ASP.NET We have integrated a third party payment s/w with our website which requires us to post some variables to their website, like the amount, description, billing name etc. In ASP.Net, the aspx page posts to itself which is not fitting with third party payment requirements. I have tried removing the "runat=server" in form but still doesn't appear to be working. Any ideas would be appreciated. Thanks.

    D D G I M 6 Replies Last reply
    0
    • V VK Link

      Hi, This worked fine in our ASP web site but bit of an issue with ASP.NET We have integrated a third party payment s/w with our website which requires us to post some variables to their website, like the amount, description, billing name etc. In ASP.Net, the aspx page posts to itself which is not fitting with third party payment requirements. I have tried removing the "runat=server" in form but still doesn't appear to be working. Any ideas would be appreciated. Thanks.

      D Offline
      D Offline
      Daniel Santillanes
      wrote on last edited by
      #2

      May be you thought already, but could you pass those parameters through GET method? daniero

      V 1 Reply Last reply
      0
      • D Daniel Santillanes

        May be you thought already, but could you pass those parameters through GET method? daniero

        V Offline
        V Offline
        VK Link
        wrote on last edited by
        #3

        It is a requirement for payment company that the method is POST only.

        D 1 Reply Last reply
        0
        • V VK Link

          Hi, This worked fine in our ASP web site but bit of an issue with ASP.NET We have integrated a third party payment s/w with our website which requires us to post some variables to their website, like the amount, description, billing name etc. In ASP.Net, the aspx page posts to itself which is not fitting with third party payment requirements. I have tried removing the "runat=server" in form but still doesn't appear to be working. Any ideas would be appreciated. Thanks.

          D Offline
          D Offline
          darkelv
          wrote on last edited by
          #4

          Exactly the same problem that we used to have with aspx ;) Luckily we are the payment gateway... Do you need to post and have the user redirected to the payment gateway pages? or do you only need to post the data?

          V 1 Reply Last reply
          0
          • D darkelv

            Exactly the same problem that we used to have with aspx ;) Luckily we are the payment gateway... Do you need to post and have the user redirected to the payment gateway pages? or do you only need to post the data?

            V Offline
            V Offline
            VK Link
            wrote on last edited by
            #5

            We only need to post to the payment gateway a whole bunch of variable.

            D 1 Reply Last reply
            0
            • V VK Link

              It is a requirement for payment company that the method is POST only.

              D Offline
              D Offline
              Daniel Santillanes
              wrote on last edited by
              #6

              This may sound dumb... but you may want to try using a 'hopping' ASP page, where you receive parameters through GET method as I told you, and then this page automatically posts to that other page. Of course, this should be used if you are only passing non-sensitive data. It may not be the best method but it's an idea. daniero

              1 Reply Last reply
              0
              • V VK Link

                We only need to post to the payment gateway a whole bunch of variable.

                D Offline
                D Offline
                darkelv
                wrote on last edited by
                #7

                I think you can use HttpPost though I can't remember the class/code to do that and I don't have the code with me anymore :\

                1 Reply Last reply
                0
                • V VK Link

                  Hi, This worked fine in our ASP web site but bit of an issue with ASP.NET We have integrated a third party payment s/w with our website which requires us to post some variables to their website, like the amount, description, billing name etc. In ASP.Net, the aspx page posts to itself which is not fitting with third party payment requirements. I have tried removing the "runat=server" in form but still doesn't appear to be working. Any ideas would be appreciated. Thanks.

                  G Offline
                  G Offline
                  Guffa
                  wrote on last edited by
                  #8

                  If you remove runat="server" from the form, it will surely work. Then it's all plain html and the server code doesn't care a bit what it looks like as long as it's reasonably valid html. When it's a server form, the rendering will set the action property to post back, but when it's plain html you can set it yourself. Use HtmlControls rather than WebControls in the form. The web controls uses ViewState and stuff that is not available when you don't have a server form. For any fields that you don't need to access from the server code, just use plain html. --- b { font-weight: normal; }

                  1 Reply Last reply
                  0
                  • V VK Link

                    Hi, This worked fine in our ASP web site but bit of an issue with ASP.NET We have integrated a third party payment s/w with our website which requires us to post some variables to their website, like the amount, description, billing name etc. In ASP.Net, the aspx page posts to itself which is not fitting with third party payment requirements. I have tried removing the "runat=server" in form but still doesn't appear to be working. Any ideas would be appreciated. Thanks.

                    I Offline
                    I Offline
                    Ista
                    wrote on last edited by
                    #9

                    strange its not a web service. You can create a HttpWebRequest class. then send the request. Its pretty easy and will prolly do what you need 1 line of code equals many bugs. So don't write any!!

                    1 Reply Last reply
                    0
                    • V VK Link

                      Hi, This worked fine in our ASP web site but bit of an issue with ASP.NET We have integrated a third party payment s/w with our website which requires us to post some variables to their website, like the amount, description, billing name etc. In ASP.Net, the aspx page posts to itself which is not fitting with third party payment requirements. I have tried removing the "runat=server" in form but still doesn't appear to be working. Any ideas would be appreciated. Thanks.

                      M Offline
                      M Offline
                      Mike Ellison
                      wrote on last edited by
                      #10

                      You can do cross-page posting in ASP.NET 2.0. Take a look at Dino Esposito's MSDN Article[^] on ASP.NET forms - about half-way down he describes cross-page posting nicely.

                      V 1 Reply Last reply
                      0
                      • M Mike Ellison

                        You can do cross-page posting in ASP.NET 2.0. Take a look at Dino Esposito's MSDN Article[^] on ASP.NET forms - about half-way down he describes cross-page posting nicely.

                        V Offline
                        V Offline
                        VK Link
                        wrote on last edited by
                        #11

                        We are still not yet using ASP.Net 2.0 Thanks.

                        1 Reply Last reply
                        0
                        • V VK Link

                          Hi, This worked fine in our ASP web site but bit of an issue with ASP.NET We have integrated a third party payment s/w with our website which requires us to post some variables to their website, like the amount, description, billing name etc. In ASP.Net, the aspx page posts to itself which is not fitting with third party payment requirements. I have tried removing the "runat=server" in form but still doesn't appear to be working. Any ideas would be appreciated. Thanks.

                          E Offline
                          E Offline
                          Eric Goedhart
                          wrote on last edited by
                          #12

                          Hi, I'm working on something simmular and the code below works, so the payment page is showing and the payment works fine, but it's the rough version. The idea is that i send the requested data over Https and get an xml file back with a key, i need to retrieve this key to go to the payment page. The url that my payment provider has given me is between the dots from Https... until the ? mark , and the command name i have to call is marked with xxxxxx. At the end of the code, were the Response.Redirect is i send the key i retrieve along with other parameters to the payment page. Because the data i have to send is confidential i changed all the names into parameter1 etc, but i hope this code is helpfull to you. If you have questions let me know via Skype. ------------------------------------------------------------------------------ using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Xml; using System.IO; using System.Net; using System.Text; public partial class pay : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { //Todo } protected void ReadXml_Click(object sender, EventArgs e) { //Creating the strings that call the new_payment_cluster: string A01; // These strings will hold the requested value; string A02; // that will be send after the parameters in the string A03; // string below string A04; string A05; string A06; string A07; string A08; string A09; string A10; string A11; string A12; string A13; string A14; string A15; string A16; //Setting the values of the strings A01 to A16 to the filled in //TextBoxes on the webpage that hold the transaction data to be //send to your payment provider. A01 = TextBox1.Text.ToString(); A02 = TextBox2.Text.ToString(); A03 = TextBox3.Text.ToString(); A04 = TextBox4.Text.ToString(); A05 = TextBox5.Text.ToString(); A06 = TextBox6.Text.ToString(); A07 = TextBox7.Text.ToString(); A08 = TextBox8.Text.ToString(); A09 = TextBox9.Text.ToString(); A10 = TextBox10.Text.ToString(); A11 = Text

                          V 2 Replies Last reply
                          0
                          • E Eric Goedhart

                            Hi, I'm working on something simmular and the code below works, so the payment page is showing and the payment works fine, but it's the rough version. The idea is that i send the requested data over Https and get an xml file back with a key, i need to retrieve this key to go to the payment page. The url that my payment provider has given me is between the dots from Https... until the ? mark , and the command name i have to call is marked with xxxxxx. At the end of the code, were the Response.Redirect is i send the key i retrieve along with other parameters to the payment page. Because the data i have to send is confidential i changed all the names into parameter1 etc, but i hope this code is helpfull to you. If you have questions let me know via Skype. ------------------------------------------------------------------------------ using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Xml; using System.IO; using System.Net; using System.Text; public partial class pay : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { //Todo } protected void ReadXml_Click(object sender, EventArgs e) { //Creating the strings that call the new_payment_cluster: string A01; // These strings will hold the requested value; string A02; // that will be send after the parameters in the string A03; // string below string A04; string A05; string A06; string A07; string A08; string A09; string A10; string A11; string A12; string A13; string A14; string A15; string A16; //Setting the values of the strings A01 to A16 to the filled in //TextBoxes on the webpage that hold the transaction data to be //send to your payment provider. A01 = TextBox1.Text.ToString(); A02 = TextBox2.Text.ToString(); A03 = TextBox3.Text.ToString(); A04 = TextBox4.Text.ToString(); A05 = TextBox5.Text.ToString(); A06 = TextBox6.Text.ToString(); A07 = TextBox7.Text.ToString(); A08 = TextBox8.Text.ToString(); A09 = TextBox9.Text.ToString(); A10 = TextBox10.Text.ToString(); A11 = Text

                            V Offline
                            V Offline
                            VK Link
                            wrote on last edited by
                            #13

                            Eric, Thanks for your reply. I have to post this information and can't really send it in as a querystring. It is the requirement of the payment gateway that we post the information in form of hidden variables. They have even defined the variable names. I mean like : In this case, the value for amount has to be set dynamically based on what the amount is calculated in previous page. I am passing this amount value from previous page as a session variable. I need to post this information to payment gateway in a form. Thanks. Vani

                            1 Reply Last reply
                            0
                            • E Eric Goedhart

                              Hi, I'm working on something simmular and the code below works, so the payment page is showing and the payment works fine, but it's the rough version. The idea is that i send the requested data over Https and get an xml file back with a key, i need to retrieve this key to go to the payment page. The url that my payment provider has given me is between the dots from Https... until the ? mark , and the command name i have to call is marked with xxxxxx. At the end of the code, were the Response.Redirect is i send the key i retrieve along with other parameters to the payment page. Because the data i have to send is confidential i changed all the names into parameter1 etc, but i hope this code is helpfull to you. If you have questions let me know via Skype. ------------------------------------------------------------------------------ using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Xml; using System.IO; using System.Net; using System.Text; public partial class pay : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { //Todo } protected void ReadXml_Click(object sender, EventArgs e) { //Creating the strings that call the new_payment_cluster: string A01; // These strings will hold the requested value; string A02; // that will be send after the parameters in the string A03; // string below string A04; string A05; string A06; string A07; string A08; string A09; string A10; string A11; string A12; string A13; string A14; string A15; string A16; //Setting the values of the strings A01 to A16 to the filled in //TextBoxes on the webpage that hold the transaction data to be //send to your payment provider. A01 = TextBox1.Text.ToString(); A02 = TextBox2.Text.ToString(); A03 = TextBox3.Text.ToString(); A04 = TextBox4.Text.ToString(); A05 = TextBox5.Text.ToString(); A06 = TextBox6.Text.ToString(); A07 = TextBox7.Text.ToString(); A08 = TextBox8.Text.ToString(); A09 = TextBox9.Text.ToString(); A10 = TextBox10.Text.ToString(); A11 = Text

                              V Offline
                              V Offline
                              VK Link
                              wrote on last edited by
                              #14

                              Hi, I tried a simple post to another web site - for some reason it doesn't seem to be doing anything. In the vb file: Dim httpmyReq As HttpWebRequest = _ WebRequest.Create("http://www.microsoft.com") httpmyReq.Method = "POST" In aspx page:

                              On browsing on IE, which does't it redirect to the Microsoft website? Many thanks.

                              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