title: MVC + Passing values from one controller to another controller
body: <p>I am new to MVC and would like some advice here on how to pass variable values from one controller to another controller. Basically, what I want to achieve is to perform a Facebook authentication and after successful authentication, I should get the <strong>AccessToken</strong> value and the fullpath variable value which I want to pass it to another controller for further processing with a new view. I am not sure if what I have done so far make sense:</p>
  
  <p>I have an ActionResult method (simplified to make it clearer) like this:</p>
  
  <pre><code>[HttpPost]
  public ActionResult Index(string facebookUID, string facebookAccessTok)
  {
      string fbUID = facebookUID;
      string fbAcess = facebookAccessTok;
      var fullpath = "";
  
      string uploadPath = Server.MapPath("~/upload");
      fullpath = uploadPath + "\\ProfilePic.png";
  
      return null;
  }
  </code></pre>
  
  <p>In my Index view:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      var uid = 0;
      var accesstoken = '';
  
      function grantPermission() {
          window.FB.login(function (response) {
              if (response.authResponse) {
                  uid = response.authResponse.userID;
                  accesstoken = response.authResponse.accessToken;
                  var postData = { facebookUID: uid, facebookAccessTok: accesstoken };
                  $.ajax({
                      type: 'POST',
                      data: postData,
                      success: function () {
                          // process the results from the controller action
                          window.location.href = "Publish";
                      }
                  });
              } else {
                  alert('User cancelled login');
              }
          }, { scope: 'publish_stream' });
      };
  </code></pre>
  
  <p>Inside the view above, I do a redirection to another page call "<strong>Publish</strong>" which its Controller Index ActionResult requires <strong>fbAcess</strong> and <strong>fullpath</strong> variable values for further processing. Please advice how do I pass the values over. </p>