Posting a images on facebook
Hi I am using bellow code for posting a images on facebook accountThis code is working fine/ posting images when i am using same facebook account that are using for creating a App. But when i am using another facebook account for posting this is not posting image on facebook wall.
Below is my test page links where i am using this code.
http://kietrontesting.canadadevelopershub.com/default.aspx
using ASPSnippets.FaceBookAPI;
using System;
using System.Collections.Generic;
protected void Page_Load(object sender, EventArgs e)
{
FaceBookConnect.API_Key = "632081280310444";
FaceBookConnect.API_Secret = "76e7b9a124c87793d838129830a6ff29";
if (!IsPostBack)
{
string code = Request.QueryString["code"];
if (!string.IsNullOrEmpty(code))
{
ViewState["Code"] = code;
pnlPost.Enabled = true;
btnAuthorize.Enabled = false;
}
}
}
protected void Authorize(object sender, EventArgs e)
{
FaceBookConnect.Authorize("publish_actions", Request.Url.AbsoluteUri);
}
protected void Post(object sender, EventArgs e)
{
Dictionary<string, string> data = new Dictionary<string, string>();
data.Add("link", "http://www.aspsnippets.com");
data.Add("picture", "http://www.aspsnippets.com/images/Blue/Logo.png");
data.Add("caption", "ASP Snippets");
data.Add("name", "ASP Snippets");
data.Add("message", "I like ASP Snippets");
FaceBookConnect.Post(ViewState["Code"].ToString(), "me/feed", data);
Response.Redirect("http://www.facebook.com/me/feed");
}
Design
======
<asp:Button ID="btnAuthorize" runat="server" Text="Authorize" OnClick="Authorize" /><hr />
<asp:Panel ID="pnlPost" runat="server" Enabled="false">
Message: <asp:TextBox ID="txtMessage" runat="server" TextMode="MultiLine"></asp:TextBox><br />
<asp:Button ID="btnPost" runat="server" Text="Post to Wall" OnClick="Post" />
</asp:Panel>