Share facebook on the page you manage in asp.net mvc

I'm trying to share product information on facebook from our website in asp mvc, I used the feed dialog and it works fine, but I also need additional options in the feed dialog for sharing on the page you are managing.

feed dialog

<a href="https://www.facebook.com/dialog/feed?app_id=1234567891000&link=http://www.example.com/Product/@product.ProductID&name=@product.Title&caption=Get%20More%20this%20month,%20only%20at%20example.com&description=@product.description&redirect_uri=http://www.example.com/&picture=http://www.example.com/pics/@(product.ProductID).jpg" target="_blank"><div style="width:60px;float:left;"><img style="text-align:center" src="@Url.Content("~/image/fbshare.jpg")" alt="fbshare" /></div></a> 

does not work, so I tried sharer.php

 <a target="_blank" href="http://www.facebook.com/sharer/sharer.php?s=100&amp;p[url]=http://www.example.com/Product/@product.ProductID&amp;p[images][0]=http://www.example.com/pics/@(product.ProductID).jpg&amp;p[title]=@product.Title+&amp;p[summary]=@product.description"><div style="width:60px;float:left;"><img style="text-align:center" src="@Url.Content("~/image/fbshare.jpg")" alt="fbshare" /></div></a> 

but when I exchange the file sharer.php, it shares the login page to the site, our product site is based on login, users can view all products, but when they click the buy button, they need to log in to continue.

I donโ€™t know why facebook uses my login page instead of product details?

How can I provide options such as sharing on the page you manage, dates, friends, etc.

enter image description here

it was a watch, I could not find any solution, any help would be great.

0
facebook
Mar 31 '15 at 12:24
source share
1 answer

The Facebook bot visits the common URL, captures page information (headers, images, etc.) and uses this to decide what to show to users.

Your site probably redirects the Facebook bot to the login page - so it actually does not see anything related to the product.

The usual work for this is to exclude the login for the range of Facebook IP addresses or for Facebook user agents. Typically, you should submit a simplified page to the Facebook bot.

Check out the Facebook help page on how to make sure that a Crawler (bot) can access your site: https://developers.facebook.com/docs/sharing/best-practices#crawl

0
Mar 31 '15 at 12:29
source share



All Articles