自定义Facebook分享按钮无法正常工作

时间:2014-04-04 19:46:06

标签: asp.net facebook

<meta property="og:url" content="http://localhost:8821/EventRegister.aspx" />
<meta property="og:title" content="Welcome and Share Test" />
<meta property="og:description" content="Hope it worked!!!!!!!" />

我正在开发一个asp.net项目,并想在其中放置一个facebook分享按钮。我在头部/头部编​​写了该代码,然后启动了调试模式并尝试了链接: https://www.facebook.com/sharer/sharer.php?u=http://localhost:8821/EventRegister.aspx

但我得到的只是一个空的共享页面,没有标题或描述只是描述中的localhost链接。

我怎样才能让它发挥作用?我想要可自定义的标题,图像,描述,如上面的代码。我一直在寻找它2天不停。

...谢谢

-

更新:

<a onClick="window.open('http://www.facebook.com/sharer.php?s=100&amp;p[title]=sfgsfgsfg&amp;p[summary]=sdgsdgsdg&amp;p[url]=http://localhost:8821/EventRegister.aspx','sharer','toolbar=0,status=0,width=548,height=325');" href="javascript: void(0)">Click to share.</a>

这样做了,结果仍然相同:(

1 个答案:

答案 0 :(得分:0)

是的,我在myasp.net上创建了一个免费的主机后工作...... :)不要在localhost上调试任何facebook代码,因为它无法正常工作,因为除非你有一些解决方法,否则facebook无法访问你的本地机器。