Question: I have a requirement where I need to redirect the user to another external URL from the MVC Action method and also need to post certain data to the external URL. Please suggest the possible options.

Thanks

Answer: 
You can try something like that 

```
$(function(){

// button handle the action where you want to post data and redirect
  $("#btnSubmit").click(function(){

 //ajax post to internal action
   $.ajax({
      type: "POST",
      url: '@Url.Action("ActionName","Controller"),
      data: json_object_to_post,
      success: function (result) {
           // handle the result here if required
    }
   });

   //redirect to the external action
    window.location.href = "external_url";
  });

```
Consider there are two actions:

```
 public ActionResult First()
    {
    //here store the data wither in session or tempdata
    //session["data"]=postdata;
    //temp["data"]=postdata
       return RedirectToAction(“Second”,”ControllerName”);
    }

public ActionResult Second()
{
//check for the session or temp variables
return View();
}

```

In this way you can pass the data from one Url to another