How do i implement facebook like functionality?
I've seen many websites which give facebook icon and if we click it automatically our f开发者_如何学运维riends know that we have liked that item. How can we implement that functionality? I am using C# Asp.Net
Thanks in advance :)
Simply emit an Like iframe in your ASP.Net page
<iframe src="http://www.facebook.com/plugins/like.php?
href=<% =Server.UrlEncode(Request.Url.ToString()).ToString() %>
&layout=standard&show_faces=true&width=450&action=like
&colorscheme=light&height=80" scrolling="no" frameborder="0"
style="border:none; overflow:hidden; width:450px; height:80px;"
allowTransparency="true"></iframe>
notice <% =Server.UrlEncode(Request.Url.ToString()).ToString() %>
this makes you like plugin refer any page you are in your website.
While you can do it with C#, your life will be A LOT easier if you do it with JavaScript in a ASP.NET application. To get started look at the Facebook Javascript SDK
If you absolutely insist on doing this through C# I would recommend using the C# Facebook sdk.
Using the Like social plugin.
精彩评论