ASP.NET => Passing "hidden" values programatically to another site

laredo512

Regular
Joined
Jan 6, 2004
Messages
88
Location
Far enough to see snow in winter
Hey people!

I have to build a payment page for a given site. The API from the payment processor permits us to send hidden values as a POST to a designated HTTPS address.

The goal is to collect 3 text fields from our form and then pass those without the user seeing the values while redirecting the user to the actual secure form on the remote site.

In other words, I don't want to use response.redirect since the user will see the values being passed. Is there another way ? Webclient ?

Thanks
 
laredo512 said:
Hey people!

I have to build a payment page for a given site. The API from the payment processor permits us to send hidden values as a POST to a designated HTTPS address.

The goal is to collect 3 text fields from our form and then pass those without the user seeing the values while redirecting the user to the actual secure form on the remote site.

In other words, I don't want to use response.redirect since the user will see the values being passed. Is there another way ? Webclient ?

Thanks

You can use
Visual Basic:
server.transfer("URL?asdf=1&sadf=2&dasf=3")
to move from one page to another without changing the visible text in the address bar. I am not sure this will work for you, however, if you are going to an app that is outside of your control (say mypage.aspx -> theirpage.aspx). You can also use hidden fields and request the hidden field on the 2nd page if you have control on the 2nd page, or session variables (again if you have control). If you can pass hidden variables outside of the query string, hidden is the best solution. If the variables must be in the query string, I would try the server.transfer. If what you are trying to do is get the three variables, post them to some url (or database) and transfer the client to another, then use server.transfer to first move to a second page in your app, execute the post, and then do the redirect.

Hope that helps!
Brian
 
I can try that and I'll see if this works...

Perhaps if I explained it this way it would make more sense:

Is there an equivalent to doing this programmatically:

<form name="form1" id="form1" method="post" action="https://remotesite.com/xample.php">
<input type="hidden" name="transaction" value="whatever" />

I want to be able to set those in my code dynamically before the user goes to the foreign site.

Thanks
 
Back
Top