开发者

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() %>
&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like
&amp;colorscheme=light&amp;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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜