title: facebook application redirects to redirect_uri location
body: <p>Let me put my code first
       string strSigned = Request.Params["signed_request"];
                 // JSONObject obj = JSONObject.CreateFromString(strSigned);</p>
  
  <pre><code>            Facebook.FacebookSignedRequest fb = FacebookSignedRequest.Parse(AppSecret, strSigned);
  
              JsonObject jsonObj = fb.Data as JsonObject;
  
              if (!jsonObj.ContainsKey("user_id"))
              {
                  string appId = App_Id;
  
  
                  string redirectUrl = "http://127.0.0.1/Default.aspx"
  
                  string redirectstr = "https://www.facebook.com/dialog/oauth?client_id=" + appId + "&amp;redirect_uri=" + redirectUrl + "&amp;scope=email,read_stream";
  
                  Page.ClientScript.RegisterStartupScript(this.GetType(), "redirect", "&lt;script&gt;top.location.href='" +redirectstr +"'&lt;/script&gt;");
  
                  Response.Clear();
              }
              else
              {
                  Response.Write(jsonObj["user_id"].ToString());
              }
  </code></pre>
  
  <p>Above code runs perfectly untill user press allow permissions.the application is actually redirecting to the mentioned redirect_uri http:... and not staying within facebook.</p>
  
  <p>i am really bugged with this.let me know the solution.</p>