Like POST data for an external URL in MVC4 using the server side

Simple question:

Now I have this form in my opinion:

<form action="https://www.xyz.com/xyz/ISO/NewPayment" method="post" name="payform"> <input type="hidden" name="session_id" value="@Model.OrderId"> <input type="submit" value="Pay"> </form> 

It sends POST data and redirects the user to https://www.xyz.com/xyz/ISO/NewPayment .

So simple, but I want to check the correctness of this data on the server side before the user is redirected to an external URL.

How can I do this in asp.net MVC? How can I send POST data from the server side and then redirect the user?

Hi

+8
c # asp.net-mvc asp.net-mvc-4
source share
1 answer

Use WebClient or HttpWebRequest on the server side for POST data. This works in any .net code, not just mvc.

+2
source share

All Articles