title: Use Request and Response variables in the static web method
body: <p>Here is my code,</p>
  
  <pre><code>[WebMethod]
  public static bool FirstAccess()
  {
      string app_id = "139295982898884";
      string app_secret = "b5d2a88b56898610d54da2af498e3220";
      //string post_login_url = "http://dev.fitbook.com.asp1-23.ord1-1.websitetestlink.com/v4/FitbookContest.aspx";
      string post_login_url = "http://localhost:4327/FitbookContest.aspx";
      string scope = "publish_stream,manage_pages";
  
      string code = HttpContext.Current.Request["code"] ?? "";
  
      try
      {
          if (code == "")
          {
              string dialog_url = "http://www.facebook.com/dialog/oauth?" + "client_id=" + app_id + "&amp;redirect_uri=" + HttpContext.Current.Server.UrlEncode(post_login_url) + "&amp;scope=publish_stream";
              // HttpContext.Current.Response.Write(dialog_url);
              //HttpContext.Current.Response.Redirect(dialog_url, true);
              return false;
          }
          else
          {
              Dictionary&lt;string, string&gt; tokens = new Dictionary&lt;string, string&gt;();
  
              string url = string.Format("https://graph.facebook.com/oauth/access_token?client_id={0}&amp;redirect_uri={1}&amp;scope={2}&amp;code={3}&amp;client_secret={4}", app_id, HttpContext.Current.Request.Url.AbsoluteUri, scope, HttpContext.Current.Request["code"].ToString(), app_secret);
  
              HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;
              using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
              {
                  StreamReader reader = new StreamReader(response.GetResponseStream());
                  string vals = reader.ReadToEnd();
                  foreach (string token in vals.Split('&amp;'))
                  {
                      //meh.aspx?token1=steve&amp;token2=jake&amp;...
                      tokens.Add(token.Substring(0, token.IndexOf("=")), token.Substring(token.IndexOf("=") + 1, token.Length - token.IndexOf("=") - 1));
                  }
              }
              access_token = tokens["access_token"];
              TestFB.GetProfilePic(code);
              return true;
          }
      }
      catch (Exception ex)
      {
          return false;
      }
  }
  </code></pre>
  
  <p>Here the lines like</p>
  
  <pre><code>HttpContext.Current.Request["code"] ?? "";
  </code></pre>
  
  <p>and</p>
  
  <pre><code>HttpContext.Current.Response.Redirect(dialog_url, true);
  </code></pre>
  
  <p>are not working. So is there any alternative solution for it? Is there any way to use it? </p>