在asp.net mvc中管理页面上的facebook共享 [英] facebook share on page you manage in asp.net mvc

查看:47
本文介绍了在asp.net mvc中管理页面上的facebook共享的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图在ASP MVC中从我们的网站上在Facebook中共享产品详细信息,我使用了Feed对话框,并且效果很好,但是我需要Feed对话框中的其他选项才能在您管理的页面上共享

i am trying to share product details in facebook from our website in asp mvc, i used feed dialog and it works fine, but i need and additional options in feed dialog to share on page you manage

提要对话框

<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>

没有用,所以我尝试了 sharer.php

didn't 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>

但是当我使用sharer.php分享它共享我的网站登录页面时,我们的产品网站是基于登录的,用户可以查看所有产品,但是当他们单击购买"时,他们必须登录才能继续进行操作.

but when i share using sharer.php it shares my site login Page, our product site is login based, users can view all products , but when they click buy , they have to login to proceed further.

我不知道,为什么Facebook分享我的登录页面而不是产品详细信息?

i dont know, why does facebook share my login Page instead of product details ?

我如何提供诸如在您管理的页面上共享,时间轴,朋友等之类的选项?

How can i provide options like share on page you manage, timeline , friends etc ?

已经好几个小时了,我仍然找不到任何解决方案,任何帮助都很好.

its been hours, i couldn't find any solution still, any help would be great.

推荐答案

Facebook机器人访问共享的URL,获取页面信息(标题,图像等),然后使用该信息来决定向用户显示什么内容.

A Facebook bot visits the shared URL, grabs the page information (headers, images etc) and uses that to decide what to display to the users.

您的网站可能会将Facebook机器人重定向到登录页面-因此实际上看不到与该产品相关的任何内容.

Your site likely is redirecting the Facebook bot to the login page - so it does not actually see anything related to the product.

通常的解决方法是排除Facebook IP范围或Facebook用户代理的登录名.通常,您应该向Facebook机器人展示一个简化的页面.

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

查看有关如何确保爬网程序(机器人)可以访问您的网站的Facebook帮助页面: https://developers.facebook.com/docs/sharing/best-practices#crawl

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

这篇关于在asp.net mvc中管理页面上的facebook共享的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆