Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6790261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:42:16+00:00 2026-05-26T17:42:16+00:00

I have written an ASP.NET page for a customer which uses the C# Facebook

  • 0

I have written an ASP.NET page for a customer which uses the C# Facebook API to post to Facebook.

// Post to Facebook.

// Build the Arguments.
Dictionary postArgs = new Dictionary();
postArgs[“message”] = “Hello World!”;

// Post.
var response = api.Post(“/me/feed”, postArgs);

// Get New Post ID.
var id = response.Dictionary[“id”].String;

I registered the application http://developers.facebook.com/setup/ using my personal Facebook account to test the integration.

Under the section ‘Select how your app integrates with Facebook’ I chose ‘Website’ and entered the Site URL.

When I view the App under my Account Settings it has the following ‘App Settings’: Access my basic information; Access my profiel information; Post to Facebook as me; Access my data anytime.

Everything works great.

I have set up the same application using my customer’s Facebook account. I changed the Client ID and the Client Secret to the new details.

It no longer works.

When I view the App under my customer’s Account Settings it doesn’t have any of the ‘App Settings’ listed above.

My ‘App Settings’ allows the App greater access to my Facebook Account compared to my customer’s ‘App Setttings’ – which I guess is why it fails to post to my customer’s Facebook Account.

Unfortunately, I do not recall explicitly setting these ‘App Settings’ on my Facebook Account. I also can’t seem to find anywhere on Facebook where I can set these ‘App Settings’ on my customer’s account.

Can someone please help / direct me please.

Thanks in advance.

Kind Regards

Walter

Update:

Here is my code:

First of all I authenticate:

// Authenticate.
string clientId = "0123456789";
string redirectUrl = "http://www.abc.com/oauth/oauth-redirect.aspx";

Response.Redirect(string.Format("https://graph.facebook.com/oauth/authorize?client_id={0}&redirect_uri={1}", clientId, redirectUrl));

Next the oauth/oauth-redirect.aspx page is performed.

Here is the code-behind of oauth/oauth-redirect.aspx.cs:

if (Request.Params["code"] != null)
{
    Facebook.FacebookAPI api = new Facebook.FacebookAPI(GetAccessToken());

    // Build the Arguments.
    Dictionary postArgs = new Dictionary();
    postArgs["message"] = "Hello World";
    postArgs["link"] = "http://www.abc.com";
    postArgs["name"] = "abc.com";
    postArgs["type"] = "link";
    postArgs["caption"] = "www.abc.com";

    // Post.
    var response = api.Post("/me/feed", postArgs);

    // Get New Post ID.
    var id = response.Dictionary["id"].String;
}

private string GetAccessToken()
{
    if (HttpRuntime.Cache["access_token"] == null)
        {
            Dictionary args = GetOauthTokens(Request.Params["code"]);

            HttpRuntime.Cache.Insert("access_token", args["access_token"]);
        }
        return HttpRuntime.Cache["access_token"].ToString();
}

private Dictionary GetOauthTokens(string code)
{
        Dictionary tokens = new Dictionary();

        string clientId = "0123456789";
        string redirectUrl = "http://www.abc.com/oauth/oauth-redirect.aspx";
        string clientSecret = "a1a2a3a4a5a6a7a8a9a0";
        string scope = "read_friendlists,user_status,publish_stream,user_about_me,offline_access";

        string url = string.Format("https://graph.facebook.com/oauth/access_token?client_id={0}&redirect_uri={1}&client_secret={2}&code={3}&scope={4}", clientId, redirectUrl, clientSecret, code, scope);

        HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;

        using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
        {
            StreamReader reader = new StreamReader(response.GetResponseStream());

            string retVal = reader.ReadToEnd();

            foreach (string token in retVal.Split('&'))
            {
                tokens.Add(token.Substring(0, token.IndexOf("=")), token.Substring(token.IndexOf("=") + 1, token.Length - token.IndexOf("=") - 1));
            }
        }
        return tokens;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:42:17+00:00Added an answer on May 26, 2026 at 5:42 pm

    In the end I could never get the authentication to work. A workable workaround – and the way I implemented the solution for my client – was to email the status update to the Facebook account. Apparently every Facebook account has a secret email address that can be used to email Status updates. Works a treat.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have designed an ASP.NET page which create graphs. I have written a class
I have a web page written in ASP.NET and I need to retrieve the
I have written an ASP.NET MVC3 Web application which runs perfectly inside the Visual
I have a web application written in ASP.NEt/C# and javascript. It uses session variables.
I have written an ASP.NET web page with C# behind that runs an existing
I have an asp.net page for a simple blog which looks like <asp:TextBox ID=txtContent
I have a site written in ASP.NET MVC. I have a page where the
I have an asp.net web page written in C#. Using some javascript I popup
Good Morning, I'm working on an ASP.NET 3.5 webforms application and have written the
I have two sites one is written in asp.net webforms and the other one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.