Example #1
0
    protected void Page_PreRender(object sender, EventArgs e)
    {
        // Set token expiration
        tokenExpiration = FacebookProvider.GetAccessTokenExpirationFromString(txtToken.Text);

        // Set token expiration message if token seems to be valid
        if ((tokenExpiration != DateTime.MinValue) && !String.IsNullOrEmpty(txtToken.Text))
        {
            if (tokenExpiration <= DateTime.Now)
            {
                lblMessage.Text = GetString("socialnetworking.facebook.tokenexpired");
            }
            else
            {
                lblMessage.Text = String.Format(GetString("socialnetworking.facebook.tokenwillexpire"), tokenExpiration.ToString("g", CultureHelper.PreferredUICultureInfo));
            }
        }
    }