简体   繁体   中英

How to integrate Facebook like button to our asp.net c# website

The Like button lets a user share your content with friends on Facebook. When the user clicks the Like button on your site, a story appears in the user's friends' News Feed with a link back to your website., right?

i write following code, this it's just like LIKE button, i am not able to share any content of site to fb wall page

<script type="text/javascript">
    function renderFbLike() {
        var parent = document.getElementById('fblikediv');
        var child = document.getElementById('fblikeimg');
        parent.removeChild(child);

        var html2 = "<iframe src=\"http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2FVoicent&send=false&layout=standard&width=450&show_faces=false&action=like&colorscheme=light&font&height=60&appId=258346014244946\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:450px; height:40px;\" allowTransparency=\"true\"></iframe>";
            document.getElementById('fblikediv').innerHTML = html2;
    }
</script>

</head>

<body>
<div id="fblikediv"><img src="images/fb-like-button.png" id="fblikeimg" onMouseOver="return renderFbLike();"></div> 

go to this http://developers.facebook.com/docs/reference/plugins/like/ page and when you enter the parameters you want facebook generates the html and javascript codes for your page. when you implement those to your page, it works

如果你想添加任何社交插件,你不需要任何适用于C#的SDK,因为FB社交是一个公正的HTML和Js它独立工作C#sdk只需要你想建立Facebook的应用程序或任何其他东西,如登录按钮等。

Facebook限制像条款和条件中的Like按钮的功能和视图,因此在您的网站上获得Like按钮的唯一方法是使用来自Facebook的Like按钮,因为Mutu说: http//developers.facebook.com/docs/reference/插件/喜欢/如果您不需要完全喜欢,您可以使用共享功能,允许使用Javascript API自定义元素外观: https//developers.facebook.com/docs/reference/dialogs/send/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM