Last post Oct 13, 2016 04:40 AM by Deepak Panchal
Sep 23, 2016 11:23 AM|sandip5264|LINK
I've to Share my images and text (non editable) on Facebook and get response if image of text is shared or not.
Actually on my web app I have to add functionality of share my product images and my promotion text. If user is logged in he will post if not then it should ask for facebook login and share the text or image and then I should come to know if he had shared
Can anyone share some code?
Sep 24, 2016 02:52 AM|Deepak Panchal|LINK
below is example code.
<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" />
you need to add the below mentioned Namespaces
For Authorizing the user
protected void Page_Load(object sender, EventArgs e)
FaceBookConnect.API_Key = "<Your API Key>";
FaceBookConnect.API_Secret = "<Your API Secret>";
string code = Request.QueryString["code"];
ViewState["Code"] = code;
pnlPost.Enabled = true;
btnAuthorize.Enabled = false;
protected void Authorize(object sender, EventArgs e)
Code to post the content
protected void Post(object sender, EventArgs e)
Dictionary<string, string> data = new Dictionary<string, string>();
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);
Post Publish and Share content on user’s FaceBook Wall using Graph API in ASP.Net
Sep 24, 2016 07:07 AM|sandip5264|LINK
I already tried this.
API_Key and API_Secret not working as per instruction
Sep 26, 2016 09:17 AM|Deepak Panchal|LINK
you had mentioned that Api_Key and Api_Secret is not working as per instruction.
did you generate your own API_Key and API_Secret ?
and replace it in the above mentioned code.
if not please visit the link mentioned below and follow the steps to create API_Key and API_Secret.
Create FaceBook App and Facebook Application Id ( AppId ) and Secret Key
Sep 26, 2016 04:47 PM|sandip5264|LINK
Yes brother, I already had generated my own API Key and Secret Key.
Oct 07, 2016 07:51 AM|sandip5264|LINK
Deepak I tried it and now it's working.
But there is one problem that it's not sharing any content to another facebook ID. It's only sharing content with my registered facebook ID.
I need to provide functionality to my users to share my images on there facebook
Can you help with this. I tried many settings in developer.facebook.com but I'm unable to find any.
Also it shows
Client OAuth login is enabled but you haven't listed any valid OAuth redirect URIs. Click here for more information.
But when I googled on this I find many settings which now doesn't exists in facebook. Can you please help on this.?
Oct 11, 2016 06:31 AM|Deepak Panchal|LINK
its looks like you want to put Share button in your website. so when any user click on that button then he can able to share the content to his own and his friends facebook page.
use the code below will help you.
<title>Facebook share sampel</title>
<form id="form1" runat="server">
<a name="sharebutton" type="button" href="http://www.facebook.com/sharer.php">Share</a>
How to use Facebook Share functionality in ASP.NET
Oct 12, 2016 09:37 AM|sandip5264|LINK
No, I don't want to put share button. I wan't user share my images on facebook and I should get confirmation whether he has shared it or not
Oct 13, 2016 04:40 AM|Deepak Panchal|LINK
if You put the share buttons in your web page then particular user is able to share your images.
without Share button how you will going to share it.
to get the confirmation regarding sharing you need to code for it that if user share the image then save the time, user id and post to database and when you log in your system then display a notification regarding it.
if you don't want to save this details in database then simply mail these details to you when user perform the sharing operation.