Click here to Skip to main content
15,886,788 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Facebook app not working for other users.
Its only working for me.
I can only upload text on my profile.
Can't upload pic on others profiles.

plz help.
C#
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net;
using ASPSnippets.FaceBookAPI;
using System.Collections.Generic;
using System.Web.Script.Serialization;
public partial class facebook_test : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        FaceBookConnect.API_Key = "{key}";
        FaceBookConnect.API_Secret = "{secret-key}";
 
        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,> data = new Dictionary<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", txtMessage.Text);
 
        FaceBookConnect.Post(ViewState["Code"].ToString(), "me/feed", data);
        //FaceBookConnect.Post(Session["Code"].ToString(), "me/feed", data);   
    }
}
Posted
Updated 8-Jan-15 7:40am
v3
Comments
Afzaal Ahmad Zeeshan 8-Jan-15 13:41pm    
I have editted your question and removed the keys. It is not safe to share such data over the Internet. Please keep this in mind in future.

Thanks.

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