Jump to content
Xtreme .Net Talk

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


Recommended Posts

Posted

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

* using VS.NET Pro 2003 *

Posted
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

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

Posted

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

Laredo512

* using VS.NET Pro 2003 *

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...