Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to do a post in facebook on my page fan wall with c# and asp.net
    text
    copied!<p>I tryed since 3 days how i create a post my fan page wall with c#, and i note 2 things : - Facebook provides not updated documentation with no complete and poor example (api changes often) - Facebook often changes his api and lots of post are obselete. Is somebody can correct my code or provide me the complete good code ? </p> <p>This is my code :</p> <pre><code> if (String.IsNullOrEmpty(Request.QueryString["code"])) { Response.Redirect("https://graph.facebook.com/oauth/authorize?client_id=157873644371673&amp;redirect_uri=http://localhost:2551/Default.aspx&amp;scope=publish_stream,manage_pages,offline_access&amp;display=popup"); } else { FacebookClient fb = new FacebookClient(); dynamic result1 = fb.Get("oauth/access_token", new { client_id = "MY_APP_ID", client_secret = "MY_SECRET_ID", grant_type = "client_credentials", redirect_uri = "www.mysite.com" }); fb.AppId = "MY_APP_ID"; fb.AppSecret = "MY_SECRET_ID"; fb.AccessToken = result1.access_token; dynamic parameters = new ExpandoObject(); parameters.message = "Check out this funny article"; parameters.link = "http://www.example.com/article.html"; parameters.picture = "http://www.example.com/article-thumbnail.jpg"; parameters.name = "Article Title"; parameters.caption = "Caption for the link"; parameters.description = "Longer description of the link"; parameters.req_perms = "manages_pages"; parameters.scope = "manages_pages"; parameters.actions = new { name = "View on Zombo", link = "www.zombo.com", }; parameters.privacy = new { value = "ALL_FRIENDS", }; try { var result = fb.Post("/" + "MY_FACEBOOK_FAN_PAGE_ID" + "/feed", parameters); } catch (FacebookOAuthException ex) { //handle something Response.Write(ex.Message); } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload