Click here to Skip to main content
15,898,795 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Below is the code through with i am able successfully post it to my facebook wall from my website but i am not able to post to my facebook page.


C#
var client = new FacebookClient();

                    dynamic token = client.Get("oauth/access_token", new
                    {
                        client_id = ConfigurationManager.AppSettings["FacebookAPI"].ToString(),
                        client_secret = ConfigurationManager.AppSettings["FacebookAPIKey"].ToString(),
                        grant_type = "client_credentials"
                    });
                    client.AccessToken = token.access_token;

                    dynamic parameters = new ExpandoObject();
                    parameters.title = detail.Title;
                    parameters.message = GetDescription(detail.Description, detail.Content);
                    parameters.link = "http://test.com/blog" + detail.RelativeLink;//HttpContext.Current.Request.IsLocal ? "http://test.com/blog" + detail.RelativeLink : HttpContext.Current.Request.Url.Authority + "" + detail.RelativeLink;

                    var result = client.Post(ConfigurationManager.AppSettings["FacebookPageID"].ToString() + "/feed", parameters);
Posted
Updated 8-May-15 0:46am
v2

1 solution

I think without an APP, you can't post.

Refer for complete code and implementation - How to do a post in facebook on my page fan wall with c# and asp.net[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900