This article briefly shows how to use a Facebook like feature in ASP.Net. This feature provides the ability to like a page and show the total number of users who liked the app.
First of all you need to get a login for Facebook and create a new page and select the type of page and fill in the required details and click the get started button.
Image 1.
Image 2.
Upload an image for that page and click the "Next" button.
Image 3.
Now provide the optional details and click "Save info".
Image 4.
Image 5.
Image 6.
Image 7.
As you can see the page URL, your page is done here.
You can generate page code after from the developer link and click on "Core Concepts" and click on the like link button and fill in this form and click the "Get Code" button.
Image 8.
This is the code:
<div id="fb-root">
</div>
<script> (function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
} (document, 'script', 'facebook-jssdk'));
</script>
Put this script and div in the head tag and put the page URL in the data-href.
<div class="fb-like-box" data-href="http://www.facebook.com/MyBMWRAJ?ref=hl"
data-width="213" data-show-faces="true" data-stream="false" data-border-color="#d9509c"
data-header="true" style="padding-bottom: 10px;" async="false">
</div>
Put this div in the form tag.
Now run the application to see the result.
Image 9.