protected void Page_Load(object sender, EventArgs e) { this.RegisterAsyncTask( new PageAsyncTask( async ct => { if (TwitterConsumer.IsTwitterConsumerConfigured) { this.MultiView1.ActiveViewIndex = 1; if (!IsPostBack) { var tuple = await TwitterConsumer.TryFinishSignInWithTwitterAsync(); if (tuple != null) { string screenName = tuple.Item1; int userId = tuple.Item2; this.loggedInPanel.Visible = true; this.loggedInName.Text = screenName; // In a real app, the Twitter username would likely be used // to log the user into the application. ////FormsAuthentication.RedirectFromLoginPage(screenName, false); } } } })); }