Thread was being aborted

Sep 18, 2008 at 11:28 AM
I using Facebook Toolkit 1.7 to develop an iframe project (Visual Studio 2005). Below is my coding

protected void Page_Load(object sender, EventArgs e)
    {

        // ApplicationKey and Secret are acquired when you sign up for
        _fbService.ApplicationKey = FACEBOOK_API_KEY;
        _fbService.Secret = FACEBOOK_SECRET;
        _fbService.IsDesktopApplication = false;

 
        string sessionKey = Session["facebook_session_key"] as String;
        string userId = Session["facebook_userId"] as String;

        // When the user uses the facebook login page, the redirect back here will will have the auth_token in the query params
        string authToken = Request.QueryString["auth_token"];

        // We have already established a session on behalf of this user
        if (!String.IsNullOrEmpty(sessionKey))
        {
            _fbService.SessionKey = sessionKey;
            _fbService.UserId = userId;

         
        }
        // This will be executed when facebook login redirects to our page
        else if (!String.IsNullOrEmpty(authToken))
        {
         
            _fbService.CreateSession(authToken);
       
            Session["facebook_session_key"] = _fbService.SessionKey;
            Session["facebook_userId"] = _fbService.UserId;
            Session["facebook_session_expires"] = _fbService.SessionExpires;
        }
        // Need to login
        else
        {
         
            Response.Redirect(@"http://www.facebook.com/login.php?api_key=" + _fbService.ApplicationKey + @"&v=1.0", false);
        }



    }


  protected override void OnPreRender(EventArgs e)
    {
        Response.AppendHeader("P3P", "CP=\"CAO PSA OUR\"");
        base.OnPreRender(e);
    }

The project was in the loop nonstop. I already change to  Response.Redirect("", false);, but still same problem.
I change the code like following

public partial class MyStyle : CanvasIFrameBasePage
{
    private string FACEBOOK_API_KEY = ConfigurationManager.AppSettings["FacebookAPIKey"];
    private string FACEBOOK_SECRET = ConfigurationManager.AppSettings["FacebookSecret"];

    new protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            base.Api = FACEBOOK_API_KEY;
            base.Secret = FACEBOOK_SECRET;
            base.Page_Load(sender, e);
        }
}

  protected override void OnPreRender(EventArgs e)
    {
        Response.AppendHeader("P3P", "CP=\"CAO PSA OUR\"");
        base.OnPreRender(e);
    }
}

But the same problem occur, the project loop in nonstop.

Please provide some help.

thank you