Reputation: 8741
I'm a novice asp.net developer and know next to nothing about javascript.
I know this should be easy but...
I think I need to add a Facebook Like button to a asp.net (C#) website. When a user clicks, it should add a reference to my site onto their Facebook wall - if it first takes them to a Facebook login page that's fine. I'm not sure the Like button is the correct control for this. I've looked into using the C# Facebook SDK on codeplex but there's no documentation and the samples don't seem to do anything.
I've taken the following code from the facebook dev site:
<iframe src="http://www.facebook.com/plugins/like.php?href=www.blank.co.uk&layout=standard&show_faces=false&width=450&action=like&font&colorscheme=light&height=35"
scrolling="no" frameborder="0" style="border: none; overflow: hidden; width: 200px;
height: 200px;" allowtransparency="true"></iframe>
This doesn't seem to do anything except increase the counter value next to the text box.
Could anyone please advise best way to implment this functionality. If there's any good documentation / tutorial for using the C# Facebook SDK that could be very helpful since it's likely I'll need to implment more Facebook integration in future.
Many thanks
Rob.
Upvotes: 1
Views: 7012
Reputation: 2226
Have you tried using the XFBML code that can be generated on the Facebook Like Button page?
It looks straing forward enough that this should work for you.
Upvotes: 0
Reputation: 20415
Did you follow the steps at https://developers.facebook.com/docs/reference/plugins/like/?
Here is the iframe for http://stackoverflow.com that just takes the defaults:
<iframe
src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fstackoverflow.com&layout=standard&show_faces=true&width=450&action=like&font&colorscheme=light&height=80"
scrolling="no"
frameborder="0"
style="border:none; overflow:hidden; width:450px; height:80px;"
allowTransparency="true">
</iframe>
Here is the XFBML for http://stackoverflow.com that just takes the defaults:
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<fb:like href="http://stackoverflow.com" show_faces="true" width="450" font=""></fb:like>
Upvotes: 1