8

Simple question:

Now I have that form in my view:

<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 send POST data and redirect user to https://www.xyz.com/xyz/ISO/NewPayment.

So simple, but I want to check on server side correctness of that data, before user will be redirected to a external URL.

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

Regards

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

2 Comments

could you give me an example, how can I use it in controller, where I have to return ActionResult? Regards
@fejesjoco I know this is old question/answer, but the example provided doesn't redirect the user to the external url/page afterward?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.