FB Like和Send

时间:2012-09-04 10:35:22

标签: c# asp.net-mvc facebook-graph-api

我正在研究FB和发送按钮,我遇到了这些问题 我创建了一个带有一些元标记信息的页面,因为FB对象调试器可以验证页面 在本节中,我将og:url设置为类似按钮所在页面的URL

并且在类似按钮的href属性上我给了Request.URL,问题是它不喜欢/发送我提到的URL og:url而不是发送Facebook.com的消息

以下是我的元信息

<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# tbsname: http://ogp.me/ns/fb/tbsname#">
  <meta property="fb:app_id" content="242015609188249" />   
  <meta property="og:url" content="http://mywebsite.com/Course/Profile/1381765" />
  <meta property="og:title"  content="Details" /> 
  <meta property="og:description" content="" />

下面是我喜欢FB的按钮:

  <div class="fb-like" data-href="@Request.Url" data-send="true" data-layout="button_count" data-width="450" data-show-faces="true"></div>

我在浏览器中访问http://mywebsite.com/Course/Profile/1381765

1 个答案:

答案 0 :(得分:0)

类似按钮的代码应为

<div class="fb-like" data-href="http://mywebsite.com/Course/Profile/1381765" data-send="true" data-layout="button_count" data-width="450" data-show-faces="true"></div>