user1142462
user1142462

Reputation: 43

using Post method for only some parameters in Asp.net

I have a form in asp.net containing more than 20 textboxes. I have to use POST method to send only some of the parameters to payment gateway. Is there any way so that only required parameters from the form can be posted to payment gateway? Any help will be appreciated.

Upvotes: 0

Views: 404

Answers (3)

marc.d
marc.d

Reputation: 3844

input-element without a name-attribute wont be submitted, so just remove the name-attribute on those fields and your fine.

Upvotes: 0

Paolo Falabella
Paolo Falabella

Reputation: 25844

Have you tried just posting ALL your web form elements to the payment gateway? Chances are their page will just use the parameters they are expecting to receive and just ignore the others (that is the default behavior in web pages, interpret what you can and just ignore the rest).

If so, you would just need to make sure the client name of your form elements matches the name of the parameters the payment gateway is expecting to receive.

Since it's a webforms application, you may want to look at How to: Post ASP.NET Web Pages to a Different Page on the MSDN.

Upvotes: 0

BrokenGlass
BrokenGlass

Reputation: 160942

You could either make an explicit post with the values you want e.g. using jQuery (see jQuery.post()) or copy the values to another form that contains only the values of interest and submit that one.

Upvotes: 2

Related Questions